Skip to main content

spec_driven_docs/cli/
track.rs

1//! `track` subcommand: parse-shape.
2//!
3//! Holds the clap derive structs only. No I/O, no business logic.
4
5use camino::Utf8PathBuf;
6
7/// Report or check the tracking registry.
8#[derive(Debug, clap::Args)]
9pub struct TrackArgs {
10    /// The operation to run.
11    #[command(subcommand)]
12    pub command: TrackCommand,
13}
14
15/// The two tracking operations.
16#[derive(Debug, clap::Subcommand)]
17pub enum TrackCommand {
18    /// Report registry freshness offline.
19    Status(StatusArgs),
20    /// Compare each pinned Git revision to its upstream over the network.
21    Check(CheckArgs),
22}
23
24/// `sdd track status`: an offline freshness report.
25#[derive(Debug, clap::Args)]
26pub struct StatusArgs {
27    /// The instance to read; absolute, or the working directory.
28    #[arg(long, default_value = ".")]
29    pub target: Utf8PathBuf,
30
31    /// Judge freshness as of this ISO date rather than today.
32    #[arg(long)]
33    pub as_of: Option<String>,
34
35    /// Emit one JSON object rather than lines.
36    #[arg(long)]
37    pub json: bool,
38}
39
40/// `sdd track check`: the one network-enabled operation.
41#[derive(Debug, clap::Args)]
42pub struct CheckArgs {
43    /// The instance to read; absolute, or the working directory.
44    #[arg(long, default_value = ".")]
45    pub target: Utf8PathBuf,
46
47    /// Check only the entry with this id.
48    #[arg(long)]
49    pub id: Option<String>,
50
51    /// Exit 1 when a completed lookup finds a different revision.
52    #[arg(long)]
53    pub fail_on_update: bool,
54
55    /// Emit one JSON object rather than lines.
56    #[arg(long)]
57    pub json: bool,
58}