✨ 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:
committed by
Jeremiah Russell
parent
01776687fb
commit
fb0a3cc640
@@ -22,11 +22,14 @@ pub struct ConfigCli {
|
|||||||
#[clap(flatten)]
|
#[clap(flatten)]
|
||||||
logging: clap_verbosity_flag::Verbosity,
|
logging: clap_verbosity_flag::Verbosity,
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: Option<Commands>,
|
command: Commands,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ConfigCli {
|
impl ConfigCli {
|
||||||
pub fn run(&self, _config: Config) -> Result<()> {
|
pub fn run(&self, config: Config) -> Result<()> {
|
||||||
Ok(())
|
match &self.command {
|
||||||
|
Commands::Rules(rules_cli) => rules_cli.run(config),
|
||||||
|
Commands::Label(label_cli) => label_cli.run(config),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user