Skip to main content

commit_wizard/cli/cmd/bump/
mod.rs

1use clap::Args as ClapArgs;
2
3use crate::{
4    cli::CliResult,
5    core::{context::Context, version},
6};
7
8#[derive(Debug, Clone, ClapArgs)]
9#[command(
10    about = "Calculate the next semantic version based on the active Commit Wizard rules and selected commit history"
11)]
12pub struct Args {
13    /// Beginning of commit range
14    #[arg(long)]
15    pub from: Option<String>,
16
17    /// End of commit range
18    #[arg(long, default_value = "HEAD")]
19    pub to: String,
20
21    /// Validate the last N commits (0 = all)
22    #[arg(long, alias = "count", value_name = "N")]
23    pub tail: Option<u32>,
24}
25
26pub async fn run(ctx: &Context, args: Args) -> CliResult<()> {
27    version::bump::run(ctx, args.from, args.to, args.tail)
28}