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    /// List packages whose sources differ from the declared version
41    Diff {
42        #[arg(short, long)]
43        short: bool,
44    },
45    /// Bash completions
46    ///
47    /// tagit completions > /usr/share/bash-completion/completions/tagit
48    Completions,
49    /// Generate docs
50    ///
51    /// Writes manpages to ./target/man1
52    Doc,
53}