♻️ refactor(cli): restructure rules CLI

- move rules_cli.rs to config_cli/rules_cli.rs
- remove update command
This commit is contained in:
Jeremiah Russell
2025-10-09 07:12:33 +01:00
committed by Jeremiah Russell
parent 7bac3ccd1d
commit cd6858f4bd

View File

@@ -7,6 +7,19 @@ mod rm_cli;
use add_cli::AddCli; use add_cli::AddCli;
use rm_cli::RmCli; use rm_cli::RmCli;
#[derive(Debug, Subcommand)]
pub enum RulesCommands {
/// List the rules configured and saved in the config file
#[clap(name = "list")]
List,
/// Add a rules to the config file
#[clap(name = "add")]
Add(AddCli),
/// Remove a rule from the config file
#[clap(name = "remove", alias = "rm")]
Remove(RmCli),
}
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
pub struct RulesCli { pub struct RulesCli {
/// Configuration commands /// Configuration commands
@@ -20,23 +33,6 @@ impl RulesCli {
RulesCommands::List => config.list_rules(), RulesCommands::List => config.list_rules(),
RulesCommands::Add(add_cli) => add_cli.run(config), RulesCommands::Add(add_cli) => add_cli.run(config),
RulesCommands::Remove(rm_cli) => rm_cli.run(config), RulesCommands::Remove(rm_cli) => rm_cli.run(config),
RulesCommands::Update => todo!(),
} }
} }
} }
#[derive(Debug, Subcommand)]
pub enum RulesCommands {
/// List the rules configured and saved in the config file
#[clap(name = "list")]
List,
/// Add a rules to the config file
#[clap(name = "add")]
Add(AddCli),
/// Remove a rule from the config file
#[clap(name = "remove", alias = "rm")]
Remove(RmCli),
/// Update a rule in the config file
#[clap(name = "update")]
Update,
}