commit_wizard/
cli.rs

1use clap::{Args, Parser, Subcommand};
2
3/// 🧙‍♂️ A lightweight conventional commits assistant.
4#[derive(Parser, Debug)]
5#[command(
6    name = "commit-wizard",
7    version,
8    author,
9    about = "🧙‍♂️ A lightweight conventional commits assistant."
10)]
11pub struct Cli {
12    /// Global flags (apply to all subcommands)
13    #[command(flatten)]
14    pub global: GlobalOpts,
15
16    #[command(subcommand)]
17    pub command: Command,
18}
19
20#[derive(Args, Debug, Clone)]
21pub struct GlobalOpts {
22    /// Don't make changes; print what would happen
23    #[arg(long, global = true)]
24    pub dry_run: bool,
25}
26
27#[derive(Subcommand, Debug)]
28pub enum Command {
29    /// Start the guided commit flow
30    Commit {
31        /// Allow committing with no staged changes
32        #[arg(long)]
33        allow_empty: bool,
34    },
35}