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>,
#[arg(long, short = 'T')]
pub ticket: Option<String>,
#[arg(long = "all", short = 'A', conflicts_with = "tracked")]
pub all: bool,
#[arg(long, short = 'a')]
pub tracked: bool,
}
pub async fn run(ctx: &Context, args: Args) -> CliResult<()> {
commit::make::run(
ctx,
commit::make::Options {
allow_empty: args.allow_empty,
commit_type: args.commit_type,
scope: args.scope,
message: args.message,
breaking: args.breaking,
breaking_message: args.breaking_message,
body: args.body,
footer: args.footer,
ticket: args.ticket,
stage_all: args.all,
stage_tracked: args.tracked,
},
)
}