From 33027a6c34fc0d717b4533efebd197f0ed0513f3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 8 Oct 2025 06:16:20 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(cli):=20rename=20?= =?UTF-8?q?config=5Fcli=20to=20rules=5Fcli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rename config_cli to rules_cli for better clarity - rename ConfigCommands to RulesCommands for better clarity - rename ConfigCli to RulesCli for better clarity --- src/{config_cli.rs => rules_cli.rs} | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) rename src/{config_cli.rs => rules_cli.rs} (61%) diff --git a/src/config_cli.rs b/src/rules_cli.rs similarity index 61% rename from src/config_cli.rs rename to src/rules_cli.rs index e39a4e2..08f819e 100644 --- a/src/config_cli.rs +++ b/src/rules_cli.rs @@ -1,25 +1,26 @@ use clap::{Parser, Subcommand}; +use cull_gmail::Config; #[derive(Debug, Parser)] -pub struct ConfigCli { +pub struct RulesCli { /// Configuration commands #[command(subcommand)] - command: ConfigCommands, + command: RulesCommands, } -impl ConfigCli { - pub fn run(&self) { +impl RulesCli { + pub fn run(&self, config: Config) { match self.command { - ConfigCommands::List => todo!(), - ConfigCommands::Add => todo!(), - ConfigCommands::Remove => todo!(), - ConfigCommands::Update => todo!(), + RulesCommands::List => config.list_rules(), + RulesCommands::Add => todo!(), + RulesCommands::Remove => todo!(), + RulesCommands::Update => todo!(), } } } #[derive(Debug, Subcommand)] -pub enum ConfigCommands { +pub enum RulesCommands { /// List the rules configured and saved in the config file #[clap(name = "list")] List,