Skip to main content

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    /// Write the upgrade; without it every file's action is listed and
50    /// nothing is touched. `rk stage` is the full-byte comparison surface.
51    #[arg(long)]
52    pub apply: bool,
53
54    /// Emit one JSON object on stdout instead of the human report.
55    #[arg(long)]
56    pub json: bool,
57}