use clap::Subcommand;
use crate::{CommonDeleteArgs, CommonEditArgs, CommonGetArgs, CommonListArgs, CommonShowArgs};
#[derive(Subcommand, Clone, Debug)]
pub(crate) enum GuardCommand {
#[command(after_help = "\
FILTERS:
Filter may be a guard ID or title substring.
EXAMPLES:
govctl guard list
govctl guard list clippy
govctl guard list GUARD-CLIPPY -o json
")]
List(CommonListArgs),
#[command(after_help = "\
VALID FIELDS:
- title, refs
- description, command, timeout_secs, pattern
EXAMPLES:
govctl guard get GUARD-0001
govctl guard get GUARD-0001 description
govctl guard get GUARD-0001 command
")]
Get(CommonGetArgs),
#[command(after_help = "\
EXAMPLES:
govctl guard show GUARD-CLIPPY
govctl guard show GUARD-CLIPPY --history
govctl guard show GUARD-CLIPPY -o json
NOTES:
- Guards 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 guard new \"clippy lint\"
NOTES:
- Create the guard first, then use `guard edit` to define checks.
")]
New {
title: String,
},
#[command(after_help = "\
EXAMPLES:
govctl guard edit GUARD-0001 command --set \"cargo test\"
govctl guard edit GUARD-0001 refs --add RFC-0001
govctl guard edit GUARD-0001 refs[0] --remove
")]
Edit(CommonEditArgs),
#[command(after_help = "\
EXAMPLES:
govctl guard delete GUARD-CLIPPY
govctl guard delete GUARD-CLIPPY --force
")]
Delete(CommonDeleteArgs),
}