🔧 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:
committed by
Jeremiah Russell
parent
8f910772dd
commit
724f444133
@@ -16,31 +16,44 @@ use remove_label_cli::RemoveLabelCli;
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum SubCmds {
|
||||
/// List the rules configured and saved in the config file
|
||||
// #[clap(name = "list-rules", subcommand_help_heading = "Rules")]
|
||||
#[clap(name = "list-rules")]
|
||||
ListRules,
|
||||
/// Add a rules to the config file
|
||||
// #[clap(name = "add-rule", subcommand_help_heading = "Rules")]
|
||||
#[clap(name = "add-rule")]
|
||||
AddRule(add_rule_cli::AddRuleCli),
|
||||
/// 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")]
|
||||
RemoveRule(rm_rule_cli::RmRuleCli),
|
||||
// #[clap(name = "set-action-on-rule", subcommand_help_heading = "Rules")]
|
||||
#[clap(name = "set-action-on-rule")]
|
||||
ActionRule(ActionRuleCli),
|
||||
/// List the labels associated with a rule
|
||||
// #[clap(name = "list-labels", subcommand_help_heading = "Label")]
|
||||
#[clap(name = "list-labels")]
|
||||
List(ListLabelCli),
|
||||
/// Add label to rule
|
||||
// #[clap(name = "add-label", subcommand_help_heading = "Label")]
|
||||
#[clap(name = "add-label")]
|
||||
Add(AddLabelCli),
|
||||
/// Remove a label from a
|
||||
// #[clap(
|
||||
// name = "remove-label",
|
||||
// alias = "rm-label",
|
||||
// subcommand_help_heading = "Label"
|
||||
// )]
|
||||
#[clap(name = "remove-label", alias = "rm-label")]
|
||||
Remove(RemoveLabelCli),
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
pub struct ConfigCli {
|
||||
#[clap(flatten)]
|
||||
logging: clap_verbosity_flag::Verbosity,
|
||||
#[command(subcommand)]
|
||||
sub_command: SubCmds,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user