tix/cli/cli_wip.rs
1#[allow(clippy::wildcard_imports)]
2use super::*;
3
4/// `tix wip`'s subcommands (mission `configurable-wip-limits-01M3C6WX`, WP04).
5///
6/// The CLI parses and routes; the policy service owns every evaluation, and the
7/// schema's own validation decides whether a configuration is acceptable. Nothing
8/// here decides what a limit *means*.
9#[derive(Debug, Clone, Subcommand)]
10pub enum WipAction {
11 /// Show the configured limits, their units, and the current usage
12 Show {
13 /// Board name; default is the active board
14 #[arg(long, value_name = "BOARD")]
15 board: Option<String>,
16 },
17 /// Set or update one column's limit
18 ///
19 /// Only the flags you name change, exactly as `tix recurring edit` works, so
20 /// `tix wip set "in progress" --max-items 4` keeps the column's estimate
21 /// ceiling, unit and policy.
22 Set {
23 /// Column name, as `[kanban.<board>.columns]` spells it
24 column: String,
25 /// The most cards the column may hold
26 #[arg(long, value_name = "N")]
27 max_items: Option<u32>,
28 /// The most estimate the column's cards may add up to
29 #[arg(long, value_name = "N")]
30 max_estimate: Option<u32>,
31 /// The unit `--max-estimate` counts in; it must be declared with `tix wip unit`
32 #[arg(long, value_name = "UNIT")]
33 unit: Option<String>,
34 /// What exceeding the limit does: `warn` or `block`
35 #[arg(long, value_name = "warn|block")]
36 policy: Option<String>,
37 /// Keep the numbers but enforce nothing
38 #[arg(long)]
39 disabled: bool,
40 /// Board name; default is the active board
41 #[arg(long, value_name = "BOARD")]
42 board: Option<String>,
43 },
44 /// Remove one column's limit
45 Unset {
46 /// Column name
47 column: String,
48 /// Board name; default is the active board
49 #[arg(long, value_name = "BOARD")]
50 board: Option<String>,
51 },
52 /// Declare an estimate unit, or remove one
53 ///
54 /// A unit is a name and its factor to the board's base unit: with `d = 1` and
55 /// `w = 5`, an issue estimated `1w` counts as `5d`. A unit the board does not
56 /// declare is a `missing_conversion` refusal wherever it is used, never a zero.
57 Unit {
58 /// Unit name, e.g. `d`
59 name: String,
60 /// The factor to the board's base unit (at least 1)
61 factor: Option<u32>,
62 /// Remove the unit instead of declaring it
63 #[arg(long)]
64 remove: bool,
65 /// Board name; default is the active board
66 #[arg(long, value_name = "BOARD")]
67 board: Option<String>,
68 },
69}