use std::path::PathBuf;
use std::process::ExitCode;
use clap::{Args, Parser, Subcommand};
use crate::cmd;
#[derive(Debug, Parser)]
#[command(
name = "klasp",
version,
about = "Block AI coding agents on the same quality gates your humans hit.",
long_about = None,
)]
pub struct Cli {
#[command(subcommand)]
pub command: Cmd,
}
#[derive(Debug, Subcommand)]
pub enum Cmd {
Init(InitArgs),
Install(InstallArgs),
Uninstall(UninstallArgs),
Gate(GateArgs),
Doctor(DoctorArgs),
}
#[derive(Debug, Args)]
pub struct InitArgs {
#[arg(long)]
pub force: bool,
}
#[derive(Debug, Args)]
pub struct InstallArgs {
#[arg(long)]
pub agent: Option<String>,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub force: bool,
#[arg(long)]
pub repo_root: Option<PathBuf>,
}
#[derive(Debug, Args)]
pub struct UninstallArgs {
#[arg(long)]
pub agent: Option<String>,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub repo_root: Option<PathBuf>,
}
#[derive(Debug, Args)]
pub struct GateArgs {}
#[derive(Debug, Args)]
pub struct DoctorArgs {}
pub fn run() -> ExitCode {
let cli = Cli::parse();
match &cli.command {
Cmd::Init(args) => cmd::init::run(args),
Cmd::Install(args) => cmd::install::run(args),
Cmd::Uninstall(args) => cmd::uninstall::run(args),
Cmd::Gate(args) => cmd::gate::run(args),
Cmd::Doctor(args) => cmd::doctor::run(args),
}
}