use clap::Parser;
const EXAMPLES: &str = "\
EXAMPLES:
# Check whether a command would auto-approve (exit 0 = allowed):
safe-chains \"git status\"
# See a per-segment breakdown of why a command does or doesn't approve:
safe-chains --explain \"grep foo . && ./deploy.sh\"
# For a single command, --explain also shows the behavior it resolved to and
# names the facet that refused it (e.g. locus.remote = fixed):
safe-chains --explain \"aws dynamodb put-item --table-name t --item {}\"
# Offer to support a command safe-chains doesn't recognize. This writes or
# upgrades the local .safe-chains.toml, then prints the pin to hand-add to
# ~/.config/safe-chains.toml so the definition takes effect:
safe-chains --suggest \"mytool sync --dry-run\"
";
#[derive(Parser)]
#[command(name = "safe-chains")]
#[command(about = "Auto-allow safe bash commands in agentic coding tools")]
#[command(version, disable_version_flag = true)]
#[command(after_help = EXAMPLES)]
#[allow(clippy::struct_excessive_bools)]
pub struct Cli {
pub command: Option<String>,
#[arg(short = 'v', short_alias = 'V', long, action = clap::ArgAction::Version)]
pub version: Option<bool>,
#[arg(long)]
pub level: Option<String>,
#[arg(long)]
pub cwd: Option<String>,
#[arg(long)]
pub root: Option<String>,
#[arg(long, value_name = "ID")]
pub session_id: Option<String>,
#[arg(long)]
pub explain: bool,
#[arg(long)]
pub suggest: bool,
#[arg(long)]
pub list_commands: bool,
#[arg(long)]
pub generate_book: bool,
#[arg(long)]
pub setup: bool,
#[arg(long, value_name = "NAME")]
pub tool: Option<String>,
#[arg(long)]
pub auto_detect: bool,
#[arg(long)]
pub list_tools: bool,
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
}
#[derive(clap::Subcommand)]
pub enum Subcommand {
Hook {
#[arg(value_name = "TOOL")]
tool: String,
},
}