feat(cli): implement commands dispatching

- add logic to dispatch commands to their respective handlers
- implement `run` method to handle different commands
This commit is contained in:
Jeremiah Russell
2025-10-09 07:38:30 +01:00
committed by Jeremiah Russell
parent 01776687fb
commit fb0a3cc640

View File

@@ -22,11 +22,14 @@ pub struct ConfigCli {
#[clap(flatten)]
logging: clap_verbosity_flag::Verbosity,
#[command(subcommand)]
command: Option<Commands>,
command: Commands,
}
impl ConfigCli {
pub fn run(&self, _config: Config) -> Result<()> {
Ok(())
pub fn run(&self, config: Config) -> Result<()> {
match &self.command {
Commands::Rules(rules_cli) => rules_cli.run(config),
Commands::Label(label_cli) => label_cli.run(config),
}
}
}