🔧 chore(rules_cli): enhance CLI command structure with clap attributes

- add clap attributes for better command organization
- improve subcommand naming and aliases for usability
- attributes disabled as dependent on future clap feature
This commit is contained in:
Jeremiah Russell
2025-10-31 16:05:24 +00:00
committed by Jeremiah Russell
parent 8f910772dd
commit 724f444133

View File

@@ -16,31 +16,44 @@ use remove_label_cli::RemoveLabelCli;
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
enum SubCmds { enum SubCmds {
/// List the rules configured and saved in the config file /// List the rules configured and saved in the config file
// #[clap(name = "list-rules", subcommand_help_heading = "Rules")]
#[clap(name = "list-rules")] #[clap(name = "list-rules")]
ListRules, ListRules,
/// Add a rules to the config file /// Add a rules to the config file
// #[clap(name = "add-rule", subcommand_help_heading = "Rules")]
#[clap(name = "add-rule")] #[clap(name = "add-rule")]
AddRule(add_rule_cli::AddRuleCli), AddRule(add_rule_cli::AddRuleCli),
/// Remove a rule from the config file /// Remove a rule from the config file
// #[clap(
// name = "remove-rule",
// alias = "rm-rule",
// subcommand_help_heading = "Rules"
// )]
#[clap(name = "remove-rule", alias = "rm-rule")] #[clap(name = "remove-rule", alias = "rm-rule")]
RemoveRule(rm_rule_cli::RmRuleCli), RemoveRule(rm_rule_cli::RmRuleCli),
// #[clap(name = "set-action-on-rule", subcommand_help_heading = "Rules")]
#[clap(name = "set-action-on-rule")] #[clap(name = "set-action-on-rule")]
ActionRule(ActionRuleCli), ActionRule(ActionRuleCli),
/// List the labels associated with a rule /// List the labels associated with a rule
// #[clap(name = "list-labels", subcommand_help_heading = "Label")]
#[clap(name = "list-labels")] #[clap(name = "list-labels")]
List(ListLabelCli), List(ListLabelCli),
/// Add label to rule /// Add label to rule
// #[clap(name = "add-label", subcommand_help_heading = "Label")]
#[clap(name = "add-label")] #[clap(name = "add-label")]
Add(AddLabelCli), Add(AddLabelCli),
/// Remove a label from a /// Remove a label from a
// #[clap(
// name = "remove-label",
// alias = "rm-label",
// subcommand_help_heading = "Label"
// )]
#[clap(name = "remove-label", alias = "rm-label")] #[clap(name = "remove-label", alias = "rm-label")]
Remove(RemoveLabelCli), Remove(RemoveLabelCli),
} }
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
pub struct ConfigCli { pub struct ConfigCli {
#[clap(flatten)]
logging: clap_verbosity_flag::Verbosity,
#[command(subcommand)] #[command(subcommand)]
sub_command: SubCmds, sub_command: SubCmds,
} }