Skip to main content

spec_driven_docs/cli/
env.rs

1//! `env` subcommand: parse-shape.
2//!
3//! Holds the clap derive struct only. No I/O, no business logic.
4
5use camino::Utf8PathBuf;
6
7use crate::services::env::Item;
8
9/// Report the shell environment the gates read, or write one item of it.
10#[derive(Debug, clap::Args)]
11pub struct EnvArgs {
12    /// The repository to read; absolute, or the working directory.
13    #[arg(long, default_value = ".")]
14    pub target: Utf8PathBuf,
15
16    /// Write this item through the loader the repository records, with its
17    /// ignore entry; without it the report is printed and nothing is written.
18    #[arg(long, value_enum, value_name = "ITEM")]
19    pub apply: Option<Item>,
20
21    /// The docs scratch location the variable names, for
22    /// `--apply docs-scratch-variable`.
23    #[arg(long, value_name = "PATH", requires = "apply")]
24    pub value: Option<String>,
25
26    /// Print one JSON object instead of text.
27    #[arg(long)]
28    pub json: bool,
29}