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 payload, resolving flags over
7/// configuration and keeping recorded answers where both are silent.
8#[derive(Debug, Args)]
9pub struct UpgradeArgs {
10    /// The landed repository to upgrade.
11    #[arg(long, default_value = ".")]
12    pub target: Utf8PathBuf,
13
14    /// Override the configured payload binding.
15    #[arg(long)]
16    pub tech: Option<String>,
17
18    /// Override the configured forge.
19    #[arg(long)]
20    pub forge: Option<String>,
21
22    /// Override the configured project path.
23    #[arg(long)]
24    pub repo: Option<String>,
25
26    /// Change the recorded working-copy mode: worktree or branches. The
27    /// apply writes the answer back into the config. Omitted, the config
28    /// answers first and the recorded mode is the fallback.
29    #[arg(long)]
30    pub workflow: Option<String>,
31
32    /// Change the recorded release style: trunk or lines. A record that
33    /// already carries one needs no flag; a pre-style record needs
34    /// landing.style in the config or this flag to answer it.
35    #[arg(long)]
36    pub style: Option<String>,
37
38    /// Change the recorded Nix opt-in: `on` adds the capability's files
39    /// and records it; `off` drops them from the record while the files
40    /// stay on disk as the target's own, like any file this payload stops
41    /// shipping. Omitted, configuration precedes the recorded choice.
42    #[arg(long)]
43    pub nix: Option<String>,
44
45    /// Write the upgrade; without it every file's action is listed and
46    /// nothing is touched.
47    #[arg(long)]
48    pub apply: bool,
49
50    /// Emit one JSON object on stdout instead of the human report.
51    #[arg(long)]
52    pub json: bool,
53}