1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#[allow(clippy::wildcard_imports)]
use super::*;
#[derive(Debug, Clone, Subcommand)]
pub enum CapacityCommand {
/// List every configured ceiling, one tab-separated row per entry
///
/// Columns: `id`, `scope`, `reference`, `display`, `capacity`, `unit`,
/// `enabled`. The header prints even with no entries, so an empty section is
/// visibly empty rather than indistinguishable from a failure.
List,
/// Show one ceiling by the reference it names
///
/// A reference is a cycle's name or stable id, a team label, or an assignee
/// identity; `--scope` narrows it when one reference names two scopes.
Show {
/// Cycle name/stable id, team label, or assignee identity
#[arg(value_name = "REFERENCE")]
reference: String,
/// Restrict the match to one scope: `cycle`, `team` or `assignee`
#[arg(long, value_name = "SCOPE")]
scope: Option<String>,
},
/// Set one scope's ceiling; validated before persistence
///
/// The scope and the unit are explicit: a value with no unit, a unit no board
/// declares, an unknown cycle/team, or a second ceiling for one scope is
/// refused before `tix.toml` changes.
Set {
/// Scope dimension: `cycle`, `team` or `assignee`
#[arg(long, value_name = "SCOPE")]
scope: String,
/// The scope's reference (a cycle name or stable id, a team label, an identity)
#[arg(long, value_name = "ID")]
id: String,
/// The ceiling, in `--unit`, at or above zero
///
/// A negative value is accepted by the parser and refused by the shared
/// validator with its field path (`capacity.<id>.capacity`), which is a better
/// message than clap's "unexpected argument".
#[arg(long, value_name = "N", allow_hyphen_values = true)]
value: i64,
/// The estimate unit the ceiling counts in (declared by the active board)
#[arg(long, value_name = "UNIT")]
unit: String,
/// Keep the value and the unit, but enforce nothing
#[arg(long)]
disabled: bool,
},
/// Delete one scope's ceiling
Delete {
/// Scope dimension: `cycle`, `team` or `assignee`
#[arg(long, value_name = "SCOPE")]
scope: String,
/// The scope's reference (a cycle name or stable id, a team label, an identity)
#[arg(long, value_name = "ID")]
id: String,
},
/// Calculate one scope's committed/completed/remaining/overflow/utilization
///
/// Every value comes from the shared calculation DTO; a value the calculation
/// could not derive prints as `-`, never as a zero. Findings go to stderr.
Calculate {
/// Scope dimension: `cycle`, `team` or `assignee`
#[arg(long, value_name = "SCOPE")]
scope: String,
/// The scope's reference (a cycle name or stable id, a team label, an identity)
#[arg(long, value_name = "ID")]
id: String,
/// Also render the overflow report (estimate and reference findings always render)
#[arg(long)]
warnings: bool,
},
/// Read back a closed cycle's immutable capacity evidence
Snapshot {
/// Cycle name or stable `<schedule-id>:<sequence>` id
#[arg(value_name = "CYCLE")]
cycle: String,
/// Also render the overflow finding the close recorded
#[arg(long)]
warnings: bool,
},
}