commit_wizard/cli/cmd/commit/
mod.rs1use clap::Args as ClapArgs;
2
3use crate::{
4 cli::CliResult,
5 core::{commit, context::Context},
6};
7
8#[derive(Debug, Clone, ClapArgs)]
9#[command(about = "Create a structured Git commit using the active Commit Wizard rules")]
10pub struct Args {
11 #[arg(long)]
13 pub allow_empty: bool,
14 #[arg(long = "type", short = 't')]
16 pub commit_type: Option<String>,
17 #[arg(long, short = 's')]
19 pub scope: Option<String>,
20 #[arg(long, short = 'm')]
22 pub message: Option<String>,
23 #[arg(long, short = 'B', default_value = "false")]
25 pub breaking: bool,
26 #[arg(long, short = 'd')]
28 pub breaking_message: Option<String>,
29 #[arg(long, short = 'b')]
31 pub body: Option<String>,
32 #[arg(long, short = 'f')]
34 pub footer: Vec<String>,
35}
36
37pub async fn run(ctx: &Context, args: Args) -> CliResult<()> {
38 commit::make::run(
39 ctx,
40 args.allow_empty,
41 args.commit_type,
42 args.scope,
43 args.message,
44 args.breaking,
45 args.breaking_message,
46 args.body,
47 args.footer,
48 )
49}