helix/dna/cmd/
info.rs

1use clap::Args;
2use std::path::PathBuf;
3
4#[derive(Args)]
5pub struct InfoArgs {
6    /// Target directory to analyze (defaults to current directory)
7    #[arg(short, long)]
8    input: Option<PathBuf>,
9
10    /// File to analyze (defaults to current directory)
11    #[arg(short, long)]
12    file: Option<PathBuf>,
13
14    /// Output file path (defaults to stdout if not specified)
15    #[arg(short, long)]
16    output: Option<PathBuf>,
17
18    /// Format (defaults to text)
19    #[arg(short, long, default_value = "text")]
20    format: String,
21
22    /// Symbols (defaults to false)
23    #[arg(long)]
24    symbols: bool,
25
26    /// Sections (defaults to false)
27    #[arg(long)]
28    sections: bool,
29}
30
31pub fn run(args: InfoArgs) -> anyhow::Result<()> {
32    let input = args.input.unwrap_or_else(|| PathBuf::from("."));
33    let format = args.format;
34    let symbols = args.symbols;
35    let sections = args.sections;
36    let verbose = false; // Add default verbose parameter
37    crate::mds::info::info_command(input, format, symbols, sections, verbose)
38        .map_err(|e| anyhow::anyhow!("Info command failed: {}", e))
39}