use clap::Parser;
use fuckmit::commands::Commands;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
command: Option<Commands>,
#[arg(short, long)]
dry_run: bool,
#[arg(short = 'A', long)]
amend: bool,
#[arg(short, long)]
add_all: bool,
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
match cli.command {
Some(command) => command.execute().await?,
None => {
let dry_run = cli.dry_run;
let amend = cli.amend;
let add_all = cli.add_all;
fuckmit::commands::generate::generate_commit(dry_run, amend, add_all).await?
}
}
Ok(())
}