use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "committer")]
#[command(about = "Fast AI-powered git commit message generator", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
#[arg(short = 'y', long)]
pub yes: bool,
#[arg(short, long)]
pub dry_run: bool,
#[arg(short, long)]
pub all: bool,
#[arg(short, long)]
pub model: Option<String>,
#[arg(short = 'b', long)]
pub branch: bool,
#[arg(short = 'B', long)]
pub auto_branch: bool,
#[arg(short = 'o', long)]
pub oneline: bool,
#[arg(short = 'v', long)]
pub verbose: bool,
}
#[derive(Subcommand)]
pub enum Commands {
Config {
#[command(subcommand)]
action: ConfigAction,
},
Pr(PrArgs),
}
#[derive(Parser)]
pub struct PrArgs {
#[arg(short = 'y', long)]
pub yes: bool,
#[arg(short, long)]
pub dry_run: bool,
#[arg(short = 'D', long)]
pub draft: bool,
#[arg(short, long)]
pub base: Option<String>,
#[arg(short = 'v', long)]
pub verbose: bool,
#[arg(short, long)]
pub model: Option<String>,
}
#[derive(Subcommand)]
pub enum ConfigAction {
Show,
AutoCommit {
value: String,
},
CommitAfterBranch {
value: String,
},
Model {
value: String,
},
Verbose {
value: String,
},
}