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    /// Write the record; without it the verification runs and nothing is
34    /// touched.
35    #[arg(long)]
36    pub apply: bool,
37
38    /// Emit one JSON object on stdout instead of the human report.
39    #[arg(long)]
40    pub json: bool,
41}