🐛 fix(label_cli): display labels by rule id
- fix label listing to correctly display labels associated with a specified rule ID
This commit is contained in:
committed by
Jeremiah Russell
parent
1132a2da3c
commit
ee3c43e54d
@@ -1,6 +1,6 @@
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use cull_gmail::{Config, Result};
|
use cull_gmail::{Config, Error, Result};
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct ListCli {
|
pub struct ListCli {
|
||||||
@@ -10,7 +10,15 @@ pub struct ListCli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ListCli {
|
impl ListCli {
|
||||||
pub fn run(&self, _config: Config) -> Result<()> {
|
pub fn run(&self, config: Config) -> Result<()> {
|
||||||
|
let Some(rule) = config.get_rule(self.id) else {
|
||||||
|
return Err(Error::RuleNotFound(self.id));
|
||||||
|
};
|
||||||
|
|
||||||
|
for label in rule.labels() {
|
||||||
|
log::info!("Label in rule: `{label}`");
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user