From 098160ab78ef8247aac546f2d12081277af452e3 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 9 Oct 2025 07:12:42 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(config):=20add=20cli=20config?= =?UTF-8?q?=20=20=20-=20introduce=20cli=20config=20with=20clap=20=20=20-?= =?UTF-8?q?=20add=20subcommand=20rules=20and=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config_cli.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/config_cli.rs diff --git a/src/config_cli.rs b/src/config_cli.rs new file mode 100644 index 0000000..e2511b0 --- /dev/null +++ b/src/config_cli.rs @@ -0,0 +1,32 @@ +use clap::{Parser, Subcommand}; + +mod label_cli; +mod rules_cli; + +use cull_gmail::{Config, Result}; +use label_cli::LabelCli; +use rules_cli::RulesCli; + +#[derive(Subcommand, Debug)] +enum Commands { + /// Configure end-of-life rules + #[clap(name = "rules")] + Rules(RulesCli), + /// Add ore remove Label from rule + #[clap(name = "label")] + Label(LabelCli), +} + +#[derive(Parser, Debug)] +pub struct ConfigCli { + #[clap(flatten)] + logging: clap_verbosity_flag::Verbosity, + #[command(subcommand)] + command: Option, +} + +impl ConfigCli { + pub fn run(&self, _config: Config) -> Result<()> { + Ok(()) + } +}