1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! Arguments for `rk lines`.
use camino::Utf8PathBuf;
use clap::{Args, Subcommand};
/// Open, inventory, mint candidates on, and retire the release lines.
#[derive(Debug, Args)]
pub struct LinesArgs {
/// What to do with the lines.
#[command(subcommand)]
pub action: LinesAction,
}
/// The line verbs. A line is `release/<major>.<minor>`: cut from an
/// explicit base, validated through the candidates it mints, released by
/// hand, and retired only behind its tags.
#[derive(Debug, Subcommand)]
pub enum LinesAction {
/// Report every release line — its tags, its tag coverage, and its
/// seat — offline.
List {
/// The repository to read; any of its worktrees names it.
#[arg(long, default_value = ".")]
target: Utf8PathBuf,
/// Emit one JSON object on stdout instead of the human report.
#[arg(long)]
json: bool,
},
/// Open `release/<line>` at an explicit base, seated per the recorded
/// workflow mode; preview by default.
Open {
/// The line's `<major>.<minor>`.
line: String,
/// The commit-ish the line is cut from — the tag it patches. A
/// line is a snapshot of a chosen commit, so there is no default.
#[arg(long)]
base: Option<String>,
/// The repository to act on; any of its worktrees names it.
#[arg(long, default_value = ".")]
target: Utf8PathBuf,
/// Create the line; without it the intent is reported and nothing
/// is touched.
#[arg(long)]
apply: bool,
/// Emit one JSON object on stdout instead of the human report.
#[arg(long)]
json: bool,
},
/// Mint the line's next release candidate: write its version into the
/// manifest, commit, and push the line; the release half tags it.
/// Preview by default.
Mint {
/// The line's `<major>.<minor>`.
line: String,
/// The line's tip the caller saw; the mint refuses when the remote
/// tip, the checkout's HEAD, or the working tree moved from it.
/// Required with --apply.
#[arg(long)]
expect: Option<String>,
/// Promote the newest candidate instead: write its stable version,
/// so the line's release request proposes it. Refuses while the
/// line holds a commit that candidate did not test.
#[arg(long)]
promote: bool,
/// The repository to act on; any of its worktrees names it.
#[arg(long, default_value = ".")]
target: Utf8PathBuf,
/// Commit as the account the forge names for the job's bot
/// credential, read before any file is written; a bash or python
/// line only. Without it the commit takes the caller's identity.
#[arg(long)]
as_bot: bool,
/// Commit and push the candidate's version; without it the intent
/// is reported and nothing is touched.
#[arg(long)]
apply: bool,
/// Emit one JSON object on stdout instead of the human report.
#[arg(long)]
json: bool,
},
/// Report a line's newest candidate tag and the next number a finding
/// would mint; read-only, because a tag is never hand-authored.
Rc {
/// The line's `<major>.<minor>`.
line: String,
/// The repository to read; any of its worktrees names it.
#[arg(long, default_value = ".")]
target: Utf8PathBuf,
/// Emit one JSON object on stdout instead of the human report.
#[arg(long)]
json: bool,
},
/// Retire a line that left production: the seat before the branch,
/// only behind its tags, and only under --apply; the remote deletion
/// stays the operator's.
Retire {
/// The line's `<major>.<minor>`.
line: String,
/// The repository to act on; any of its worktrees names it.
#[arg(long, default_value = ".")]
target: Utf8PathBuf,
/// Remove the seat and delete the local branch; without it the
/// intent is reported and nothing is touched.
#[arg(long)]
apply: bool,
/// Emit one JSON object on stdout instead of the human report.
#[arg(long)]
json: bool,
},
}