release_kit/cli/upgrade.rs
1//! Arguments for `rk upgrade`.
2
3use camino::Utf8PathBuf;
4use clap::Args;
5
6/// Take a landed target to this binary's projection.
7///
8/// Flags resolve over configuration, and recorded answers stand where
9/// both are silent. Preview by default; `--apply` replaces every recorded
10/// generated file, preserves every seeded and state file, and rewrites
11/// the receipt last.
12#[derive(Debug, Args)]
13pub struct UpgradeArgs {
14 /// The landed repository to upgrade.
15 #[arg(long, default_value = ".")]
16 pub target: Utf8PathBuf,
17
18 /// Override the configured binding.
19 #[arg(long)]
20 pub tech: Option<String>,
21
22 /// Override the configured forge.
23 #[arg(long)]
24 pub forge: Option<String>,
25
26 /// Override the configured project path.
27 #[arg(long)]
28 pub repo: Option<String>,
29
30 /// Change the recorded working-copy mode: worktree or branches. The
31 /// apply writes the answer back into the config. Omitted, the config
32 /// answers first and the recorded mode is the fallback.
33 #[arg(long)]
34 pub workflow: Option<String>,
35
36 /// Change the recorded release style: trunk or lines. A record that
37 /// already carries one needs no flag; a pre-style record needs
38 /// landing.style in the config or this flag to answer it.
39 #[arg(long)]
40 pub style: Option<String>,
41
42 /// Change the recorded Nix opt-in: `on` adds the capability's files
43 /// and records it; `off` drops them from the record while the files
44 /// stay on disk as the target's own, like any file this binary stops
45 /// shipping. Omitted, configuration precedes the recorded choice.
46 #[arg(long)]
47 pub nix: Option<String>,
48
49 /// Change the recorded Scorecard opt-in: `on` adds the workflow and
50 /// records it; `off` drops it from the record while the file stays on
51 /// disk as the target's own, like any file this binary stops shipping.
52 /// Omitted, configuration precedes the recorded choice.
53 #[arg(long)]
54 pub scorecard: Option<String>,
55
56 /// Change the recorded code scanning provider: `codeql` or `semgrep`
57 /// lands that provider's workflow and records it; `off` drops it from
58 /// the record while the file stays on disk as the target's own. Omitted,
59 /// configuration precedes the recorded choice.
60 #[arg(long, value_name = "PROVIDER")]
61 pub code_scanning: Option<String>,
62
63 /// Write the upgrade; without it every file's action is listed and
64 /// nothing is touched. `rk stage` is the full-byte comparison surface.
65 #[arg(long)]
66 pub apply: bool,
67
68 /// Emit one JSON object on stdout instead of the human report.
69 #[arg(long)]
70 pub json: bool,
71}