From ee3c43e54d746676821ec35095d2cdfbcd1e0665 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 9 Oct 2025 08:12:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(label=5Fcli):=20display=20la?= =?UTF-8?q?bels=20by=20rule=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix label listing to correctly display labels associated with a specified rule ID --- src/config_cli/label_cli/list_cli.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/config_cli/label_cli/list_cli.rs b/src/config_cli/label_cli/list_cli.rs index bcd273e..2eef597 100644 --- a/src/config_cli/label_cli/list_cli.rs +++ b/src/config_cli/label_cli/list_cli.rs @@ -1,6 +1,6 @@ use clap::Parser; -use cull_gmail::{Config, Result}; +use cull_gmail::{Config, Error, Result}; #[derive(Debug, Parser)] pub struct ListCli { @@ -10,7 +10,15 @@ pub struct 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(()) } }