Skip to main content

tagit_command/
lib.rs

1//! `clap` part of `tagit`.
2
3use clap::Subcommand;
4use tagit_changelog_command::ChangelogCommand;
5use tagit_sub_command::SubtreeCommand;
6
7/// Commands passed to `tagit` CLI.
8#[derive(Subcommand)]
9pub enum Command {
10    /// Automatically push tags for workspace packages
11    ///
12    /// For root package: X.Y.Z
13    ///
14    /// For subpackages: package/X.Y.Z
15    ///
16    /// Requires signing
17    Tag {
18        #[arg(long)]
19        dry_run: bool,
20        #[arg(long)]
21        no_retag: bool,
22        #[arg(long)]
23        total_order: bool,
24        #[arg(long)]
25        sign: Option<bool>,
26    },
27    /// Manage subtrees in the .tagit/sub/ directory
28    ///
29    /// Without a subcomand, equivalent to `tagit sub ls`
30    Sub {
31        #[command(subcommand)]
32        command: Option<SubtreeCommand>,
33    },
34    Changelog {
35        #[arg(long)]
36        dry_run: bool,
37        #[command(subcommand)]
38        command: Option<ChangelogCommand>,
39    },
40    Release {
41        #[arg(long)]
42        dry_run: bool,
43        #[arg(long)]
44        no_retag: bool,
45        #[arg(long)]
46        total_order: bool,
47        #[arg(long)]
48        sign: Option<bool>,
49        #[arg(long, short)]
50        message: Option<String>,
51    },
52    /// List packages whose sources differ from the declared version
53    Diff {
54        #[arg(long, short)]
55        short: bool,
56    },
57    /// Bash completions
58    ///
59    /// tagit completions > /usr/share/bash-completion/completions/tagit
60    Completions,
61    /// Generate docs
62    ///
63    /// Writes manpages to ./target/man1
64    Doc,
65}