Skip to main content

spec_driven_docs/cli/
debt.rs

1//! `debt` subcommand: parse-shape.
2//!
3//! Holds the clap derive structs only. No I/O, no business logic.
4
5use camino::Utf8PathBuf;
6
7/// Record, migrate, or tighten the inherited budget violations a project
8/// carries in `.spec-driven-docs/debt.yaml`.
9#[derive(Debug, clap::Args)]
10pub struct DebtArgs {
11    /// The verb.
12    #[command(subcommand)]
13    pub verb: DebtVerb,
14}
15
16/// The three ways a debt file changes, each previewing by default.
17#[derive(Debug, clap::Subcommand)]
18pub enum DebtVerb {
19    /// Record every current violation as debt. Refuses where a debt file
20    /// exists, because a baseline never widens one.
21    Baseline(DebtVerbArgs),
22    /// Convert the legacy chapter list into the dimensional file, then
23    /// remove the list. Preserves every exemption and broadens nothing.
24    Migrate(DebtVerbArgs),
25    /// Lower every ceiling to its current measurement and clear every
26    /// corrected exception. Never raises a ceiling.
27    Tighten(DebtVerbArgs),
28}
29
30/// What every verb takes.
31#[derive(Debug, clap::Args)]
32pub struct DebtVerbArgs {
33    /// The instance to act on; absolute, or the working directory.
34    #[arg(long, default_value = ".")]
35    pub target: Utf8PathBuf,
36
37    /// Write the file. Without it the verb prints what it would write and
38    /// changes nothing.
39    #[arg(long)]
40    pub apply: bool,
41}