Skip to main content

tagit_command/
lib.rs

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