feat(cli): add action subcommand

- implement action subcommand to set actions on rules
- create action_cli module to handle action-related commands
This commit is contained in:
Jeremiah Russell
2025-10-09 14:02:18 +01:00
committed by Jeremiah Russell
parent 7f43b90102
commit 6b4f0bf214

View File

@@ -1,8 +1,10 @@
use clap::{Parser, Subcommand};
mod action_cli;
mod label_cli;
mod rules_cli;
use action_cli::ActionCli;
use cull_gmail::{Config, Result};
use label_cli::LabelCli;
use rules_cli::RulesCli;
@@ -12,9 +14,12 @@ enum Commands {
/// Configure end-of-life rules
#[clap(name = "rules")]
Rules(RulesCli),
/// Add ore remove Label from rule
/// Add or remove Label from rule
#[clap(name = "label")]
Label(LabelCli),
/// Set action on a specific rule
#[clap(name = "action")]
Action(ActionCli),
}
#[derive(Parser, Debug)]
@@ -30,6 +35,7 @@ impl ConfigCli {
match &self.command {
Commands::Rules(rules_cli) => rules_cli.run(config),
Commands::Label(label_cli) => label_cli.run(config),
Commands::Action(action_cli) => action_cli.run(config),
}
}
}