use std::path::PathBuf;
use clap::Subcommand;
use crate::model::WorkItemStatus;
use crate::{
CommonDeleteArgs, CommonEditArgs, CommonGetArgs, CommonListArgs, CommonRenderArgs,
CommonShowArgs,
};
#[derive(Subcommand, Clone, Debug)]
pub(crate) enum WorkCommand {
#[command(after_help = "\
FILTERS:
Filter may be a work-item status, work-item ID, or title substring.
EXAMPLES:
govctl work list
govctl work list active
govctl work list queue -n 10
")]
List(CommonListArgs),
#[command(after_help = "\
VALID FIELDS:
- title, description, status, completed_at, refs, depends_on
- notes, acceptance_criteria
- verification.required_guards, verification.waivers
EXAMPLES:
govctl work get WI-2026-04-06-001
govctl work get WI-2026-04-06-001 description
govctl work get WI-2026-04-06-001 acceptance_criteria[0].status
govctl work get WI-2026-04-06-001 verification.required_guards
")]
Get(CommonGetArgs),
#[command(after_help = "\
EXAMPLES:
govctl work show WI-2026-04-06-001
govctl work show WI-2026-04-06-001 --history
govctl work show WI-2026-04-06-001 -o plain
NOTES:
- Work Items have no obsolete-body state, so current and archival content are equivalent.
- JSON, YAML, and TOML output is complete and cannot be combined with `--history`.
")]
Show(CommonShowArgs),
#[command(after_help = "\
EXAMPLES:
govctl work new \"Implement RFC-0005 parser\"
govctl work new \"Implement RFC-0005 parser\" --active
NOTES:
- Use `--active` to immediately start the work item.
- Add acceptance criteria before moving to `done`.
")]
New {
title: String,
#[arg(long)]
active: bool,
},
#[command(after_help = "\
EXAMPLES:
govctl work edit WI-2026-04-06-001 description --set \"Scope and why\"
govctl work edit WI-2026-04-06-001 depends_on --add WI-2026-04-06-002
govctl work edit WI-2026-04-06-001 acceptance_criteria --add \"add: Implement feature X\"
govctl work edit WI-2026-04-06-001 acceptance_criteria[0] --tick done
govctl work edit WI-2026-04-06-001 verification.required_guards --add GUARD-CARGO-TEST
")]
Edit(CommonEditArgs),
#[command(after_help = "\
EXAMPLES:
govctl work move WI-2026-04-06-001 active
govctl work move WI-2026-04-06-001 done
NOTES:
- `done` requires acceptance criteria and effective guards to pass.
- Use `work edit ... acceptance_criteria[N] --tick` to update criterion status.
")]
Move {
#[arg(value_name = "FILE_OR_ID")]
file: PathBuf,
#[arg(value_enum)]
status: WorkItemStatus,
},
#[command(after_help = "\
EXAMPLES:
govctl work delete WI-2026-04-06-001
govctl work delete WI-2026-04-06-001 --force
")]
Delete(CommonDeleteArgs),
#[command(after_help = "\
EXAMPLES:
govctl work render WI-2026-04-06-001
govctl work render WI-2026-04-06-001 --dry-run
")]
Render(CommonRenderArgs),
}