Skip to main content

release_kit/cli/
adopt.rs

1//! Arguments for `rk adopt`.
2
3use camino::Utf8PathBuf;
4use clap::Args;
5
6/// Write the landing record for a repository that already runs the
7/// convention, landed before the record existed.
8///
9/// Strict: every rendered file must match what this payload would
10/// render, and no target file is ever changed.
11#[derive(Debug, Args)]
12pub struct AdoptArgs {
13    /// The repository to adopt.
14    #[arg(long, default_value = ".")]
15    pub target: Utf8PathBuf,
16
17    /// The technology whose payload the target runs. Defaults to
18    /// detection from the version file.
19    #[arg(long)]
20    pub tech: Option<String>,
21
22    /// The forge whose payload the target runs: github or gitlab.
23    /// Defaults to detection from the target's git remote.
24    #[arg(long)]
25    pub forge: Option<String>,
26
27    /// The project path on the forge, the parameter the candidate is
28    /// rendered under. Defaults to detection from the target's git
29    /// remote.
30    #[arg(long)]
31    pub repo: Option<String>,
32
33    /// The Conventional Commit scopes this project accepts,
34    /// comma-separated, the parameter the candidate is rendered under and
35    /// the record carries. There is no record to read it from yet, so the
36    /// adoption refuses without it.
37    #[arg(long)]
38    pub scopes: Option<String>,
39
40    /// The working-copy mode the candidate is rendered under: worktree or
41    /// branches. It chooses which candidate adoption verifies against and
42    /// never blesses the disk; the default is branches, the
43    /// compatibility-safe reading of a pre-record target.
44    #[arg(long, default_value = "branches")]
45    pub workflow: String,
46
47    /// The release style the candidate is rendered under: trunk or lines.
48    /// Required: the style changes the release workflow's bytes, and an
49    /// adoption verifies bytes against exactly one rendered candidate, so
50    /// neither value is a safe guess.
51    #[arg(long)]
52    pub style: Option<String>,
53
54    /// Write the record; without it the verification runs and nothing is
55    /// touched.
56    #[arg(long)]
57    pub apply: bool,
58
59    /// Emit one JSON object on stdout instead of the human report.
60    #[arg(long)]
61    pub json: bool,
62}