use clap::Args as ClapArgs;
use crate::{
cli::CliResult,
core::{commit, context::Context},
};
#[derive(Debug, Clone, ClapArgs)]
#[command(about = "Create a structured Git commit using the active Commit Wizard rules")]
pub struct Args {
#[arg(long)]
pub allow_empty: bool,
#[arg(long = "type", short = 't')]
pub commit_type: Option<String>,
#[arg(long, short = 's')]
pub scope: Option<String>,
#[arg(long, short = 'm')]
pub message: Option<String>,
#[arg(long, short = 'B', default_value = "false")]
pub breaking: bool,
#[arg(long, short = 'd')]
pub breaking_message: Option<String>,
#[arg(long, short = 'b')]
pub body: Option<String>,
#[arg(long, short = 'f')]
pub footer: Vec<String>,
}
pub async fn run(ctx: &Context, args: Args) -> CliResult<()> {
commit::make::run(
ctx,
args.allow_empty,
args.commit_type,
args.scope,
args.message,
args.breaking,
args.breaking_message,
args.body,
args.footer,
)
}