use std::path::PathBuf;
use clap::{Arg, ArgAction, value_parser};
pub fn query_path_arg() -> Arg {
Arg::new("query_path")
.value_name("QUERY")
.value_parser(value_parser!(PathBuf))
.help("Query file or workspace directory")
}
pub fn query_text_arg() -> Arg {
Arg::new("query_text")
.short('q')
.long("query")
.value_name("TEXT")
.help("Inline query text")
}
pub fn source_path_arg() -> Arg {
Arg::new("source_path")
.value_name("SOURCE")
.value_parser(value_parser!(PathBuf))
.help("Source file to parse")
}
pub fn source_text_arg() -> Arg {
Arg::new("source_text")
.short('s')
.long("source")
.value_name("TEXT")
.help("Inline source text")
}
pub fn lang_arg() -> Arg {
Arg::new("lang")
.short('l')
.long("lang")
.value_name("LANG")
.help("Language (inferred from extension if not specified)")
}
pub fn color_arg() -> Arg {
Arg::new("color")
.long("color")
.value_name("WHEN")
.default_value("auto")
.value_parser(["auto", "always", "never"])
.help("Colorize output")
}
pub fn raw_arg() -> Arg {
Arg::new("raw")
.long("raw")
.action(ArgAction::SetTrue)
.help("Include anonymous nodes (literals, punctuation)")
}
pub fn strict_arg() -> Arg {
Arg::new("strict")
.long("strict")
.action(ArgAction::SetTrue)
.help("Treat warnings as errors")
}
pub fn format_arg() -> Arg {
Arg::new("format")
.long("format")
.value_name("FORMAT")
.default_value("typescript")
.help("Output format (typescript, ts)")
}
pub fn verbose_nodes_arg() -> Arg {
Arg::new("verbose_nodes")
.long("verbose-nodes")
.action(ArgAction::SetTrue)
.help("Include verbose node information (line/column positions)")
}
pub fn no_node_type_arg() -> Arg {
Arg::new("no_node_type")
.long("no-node-type")
.action(ArgAction::SetTrue)
.help("Don't emit Node/Point type definitions")
}
pub fn no_export_arg() -> Arg {
Arg::new("no_export")
.long("no-export")
.action(ArgAction::SetTrue)
.help("Don't export types")
}
pub fn void_type_arg() -> Arg {
Arg::new("void_type")
.long("void-type")
.value_name("TYPE")
.help("Type for void results: undefined (default) or null")
}
pub fn output_file_arg() -> Arg {
Arg::new("output")
.short('o')
.long("output")
.value_name("FILE")
.value_parser(value_parser!(PathBuf))
.help("Write output to file")
}
pub fn compact_arg() -> Arg {
Arg::new("compact")
.long("compact")
.action(ArgAction::SetTrue)
.help("Output compact JSON (default: pretty when stdout is a TTY)")
}
pub fn check_arg() -> Arg {
Arg::new("check")
.long("check")
.action(ArgAction::SetTrue)
.help("Validate output against inferred types")
}
pub fn entry_arg() -> Arg {
Arg::new("entry")
.long("entry")
.value_name("NAME")
.help("Entry point name (definition to match from)")
}
pub fn verbose_arg() -> Arg {
Arg::new("verbose")
.short('v')
.action(ArgAction::Count)
.help("Verbosity level (-v for verbose, -vv for very verbose)")
}
pub fn no_result_arg() -> Arg {
Arg::new("no_result")
.long("no-result")
.action(ArgAction::SetTrue)
.help("Skip materialization, show effects only")
}
pub fn fuel_arg() -> Arg {
Arg::new("fuel")
.long("fuel")
.value_name("N")
.default_value("1000000")
.value_parser(value_parser!(u32))
.help("Execution fuel limit")
}