use clap::{Parser, Subcommand, ValueEnum};
#[derive(Debug, Parser)]
#[command(name = "cartog")]
#[command(about = "Map your codebase. Navigate by graph, not grep.")]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
#[arg(long, global = true)]
pub json: bool,
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum EdgeKindFilter {
Calls,
Imports,
Inherits,
References,
Raises,
}
#[derive(Debug, Subcommand)]
pub enum Command {
Index {
#[arg(default_value = ".")]
path: String,
#[arg(long)]
force: bool,
},
Outline {
file: String,
},
Callees {
name: String,
},
Impact {
name: String,
#[arg(long, default_value = "3")]
depth: u32,
},
Refs {
name: String,
#[arg(long)]
kind: Option<EdgeKindFilter>,
},
Hierarchy {
name: String,
},
Deps {
file: String,
},
Stats,
}