release_kit/cli/lines.rs
1//! Arguments for `rk lines`.
2
3use camino::Utf8PathBuf;
4use clap::{Args, Subcommand};
5
6/// Open, inventory, and retire the release lines.
7#[derive(Debug, Args)]
8pub struct LinesArgs {
9 /// What to do with the lines.
10 #[command(subcommand)]
11 pub action: LinesAction,
12}
13
14/// The line verbs. A line is `release/<major>.<minor>`: cut from an
15/// explicit base, released by hand, and retired only behind its tags.
16#[derive(Debug, Subcommand)]
17pub enum LinesAction {
18 /// Report every release line — its tags, its tag coverage, and its
19 /// seat — offline.
20 List {
21 /// The repository to read; any of its worktrees names it.
22 #[arg(long, default_value = ".")]
23 target: Utf8PathBuf,
24
25 /// Emit one JSON object on stdout instead of the human report.
26 #[arg(long)]
27 json: bool,
28 },
29
30 /// Open `release/<line>` at an explicit base, seated per the recorded
31 /// workflow mode; preview by default.
32 Open {
33 /// The line's `<major>.<minor>`.
34 line: String,
35
36 /// The commit-ish the line is cut from — the tag it patches. A
37 /// line is a snapshot of a chosen commit, so there is no default.
38 #[arg(long)]
39 base: Option<String>,
40
41 /// The repository to act on; any of its worktrees names it.
42 #[arg(long, default_value = ".")]
43 target: Utf8PathBuf,
44
45 /// Create the line; without it the intent is reported and nothing
46 /// is touched.
47 #[arg(long)]
48 apply: bool,
49
50 /// Emit one JSON object on stdout instead of the human report.
51 #[arg(long)]
52 json: bool,
53 },
54
55 /// Report a line's newest candidate tag and the next number a finding
56 /// would mint; read-only, because a tag is never hand-authored.
57 Rc {
58 /// The line's `<major>.<minor>`.
59 line: String,
60
61 /// The repository to read; any of its worktrees names it.
62 #[arg(long, default_value = ".")]
63 target: Utf8PathBuf,
64
65 /// Emit one JSON object on stdout instead of the human report.
66 #[arg(long)]
67 json: bool,
68 },
69
70 /// Retire a line that left production: the seat before the branch,
71 /// only behind its tags, and only under --apply; the remote deletion
72 /// stays the operator's.
73 Retire {
74 /// The line's `<major>.<minor>`.
75 line: String,
76
77 /// The repository to act on; any of its worktrees names it.
78 #[arg(long, default_value = ".")]
79 target: Utf8PathBuf,
80
81 /// Remove the seat and delete the local branch; without it the
82 /// intent is reported and nothing is touched.
83 #[arg(long)]
84 apply: bool,
85
86 /// Emit one JSON object on stdout instead of the human report.
87 #[arg(long)]
88 json: bool,
89 },
90}