♻️ refactor(cli): restructure rules CLI
- move rules_cli.rs to config_cli/rules_cli.rs - remove update command
This commit is contained in:
committed by
Jeremiah Russell
parent
7bac3ccd1d
commit
cd6858f4bd
@@ -7,6 +7,19 @@ mod rm_cli;
|
||||
use add_cli::AddCli;
|
||||
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)]
|
||||
pub struct RulesCli {
|
||||
/// Configuration commands
|
||||
@@ -20,23 +33,6 @@ impl RulesCli {
|
||||
RulesCommands::List => config.list_rules(),
|
||||
RulesCommands::Add(add_cli) => add_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,
|
||||
}
|
||||
Reference in New Issue
Block a user