spec_driven_docs/cli/gate.rs
1//! `gate` subcommand: parse-shape.
2//!
3//! Holds the clap derive struct only. No I/O, no business logic.
4
5use crate::domain::gate_id::GateId;
6
7/// Run one delivered gate against the working directory.
8#[derive(Debug, clap::Args)]
9pub struct GateArgs {
10 /// The gate to run.
11 #[arg(value_enum, required_unless_present_any = ["list", "explain"])]
12 pub id: Option<GateId>,
13
14 /// Files to judge, or extra record roots — whatever the gate's hook
15 /// wiring passes.
16 ///
17 /// A path a gate judges is filtered; a record root it resolves is not.
18 #[arg(conflicts_with = "explain")]
19 pub files: Vec<String>,
20
21 /// List every delivered gate instead of running one.
22 #[arg(long, conflicts_with = "id")]
23 pub list: bool,
24
25 /// Report which gates judge a path, and the pattern that decided each
26 /// answer, instead of running anything.
27 #[arg(long, value_name = "PATH", conflicts_with = "list")]
28 pub explain: Option<String>,
29
30 /// Add one include glob to the gate's declared includes. Repeatable.
31 ///
32 /// A flag adds to the row's declaration rather than replacing it, and an
33 /// exclude beats an include.
34 #[arg(long, value_name = "GLOB")]
35 pub include: Vec<String>,
36
37 /// Add one exclude glob to the gate's declared excludes. Repeatable.
38 #[arg(long, value_name = "GLOB")]
39 pub exclude: Vec<String>,
40}