use std::path::PathBuf;
use clap::Parser;
use crate::explain::Format;
use crate::pattern;
use crate::pulse::HeartbeatOpts;
#[derive(Parser, Debug)]
#[command(
name = "ct-outline",
version,
about = "Report the declarations in a file or tree: kind, name, start:end span, and nesting.",
long_about = "ct-outline detects declarations heuristically per language (Rust, Python, Markdown) \
and reports each with its kind, name, and 1-based start:end line span (also \
reachable as `ct outline`) — locate a symbol, then read exactly that region with \
ct-view --range. Start lines are exact; an underivable end renders as start:?. \
See `ct-outline --explain` for agent-oriented documentation."
)]
pub struct Cli {
#[arg(long, default_value = ".")]
pub base: PathBuf,
#[arg(long)]
pub name: Option<String>,
#[arg(long, value_delimiter = ',')]
pub ext: Vec<String>,
#[arg(long)]
pub hidden: bool,
#[arg(long)]
pub follow: bool,
#[arg(long = "match")]
pub pattern: Option<String>,
#[arg(long, value_enum)]
pub mode: Option<pattern::Mode>,
#[arg(long, value_delimiter = ',')]
pub kind: Vec<String>,
#[arg(long)]
pub depth: Option<usize>,
#[arg(long)]
pub flat: bool,
#[arg(long)]
pub question: Option<String>,
#[arg(long)]
pub expect: Option<String>,
#[arg(long, alias = "emit-stdout")]
pub emit: Option<String>,
#[arg(long)]
pub emit_stderr: Option<String>,
#[arg(long)]
pub quiet: bool,
#[arg(long)]
pub json: bool,
#[arg(long, value_name = "SECS")]
pub timeout: Option<f64>,
#[command(flatten)]
pub heartbeat: HeartbeatOpts,
#[arg(long, value_enum, num_args = 0..=1, default_missing_value = "md")]
pub explain: Option<Format>,
}