1use clap::{Parser, Subcommand};
2use std::path::PathBuf;
3
4pub mod main_help;
6
7use main_help::{CLI_ABOUT, CLI_LONG_ABOUT};
8use crate::commands::stats::{StatsCommands, STATS_LONG_ABOUT};
9
10#[derive(Parser)]
12#[command(name = "ferric")]
13#[command(about = CLI_ABOUT)]
14#[command(long_about = CLI_LONG_ABOUT)]
15pub struct Cli {
16 #[arg(short = 'f', long = "flamegraph", help = "Flamegraph SVG file or directory to analyze")]
18 pub flamegraph: PathBuf,
19
20 #[arg(short = 'c', long = "compare", help = "Compare with this flamegraph file or directory")]
22 pub compare: Option<PathBuf>,
23
24 #[command(subcommand)]
26 pub command: Commands,
27}
28
29#[derive(Subcommand)]
31pub enum Commands {
32 #[command(name = "pretty-print", about = "Display the flamegraph as a formatted call tree")]
34 PrettyPrint,
35
36 #[command(name = "llm-guide", about = "Provide LLM guidance and documentation for performance analysis")]
38 LlmGuide,
39
40 #[command(name = "stats", about = "Analyze flamegraph statistics and performance characteristics")]
42 #[command(long_about = STATS_LONG_ABOUT)]
43 #[command(subcommand)]
44 Stats(StatsCommands),
45}