♻️ refactor(cli): rename run_cli to rules_cli
- rename run_cli files to rules_cli - reflect changes in module imports and subcommand names
This commit is contained in:
committed by
Jeremiah Russell
parent
f7db97dd07
commit
f9e86bf8d9
@@ -3,7 +3,7 @@ use clap::{Parser, Subcommand};
|
|||||||
mod config_cli;
|
mod config_cli;
|
||||||
mod label_cli;
|
mod label_cli;
|
||||||
mod message_cli;
|
mod message_cli;
|
||||||
mod run_cli;
|
mod rules_cli;
|
||||||
|
|
||||||
use cull_gmail::{Config, GmailClient, Result};
|
use cull_gmail::{Config, GmailClient, Result};
|
||||||
use std::error::Error as stdError;
|
use std::error::Error as stdError;
|
||||||
@@ -11,7 +11,7 @@ use std::error::Error as stdError;
|
|||||||
use config_cli::ConfigCli;
|
use config_cli::ConfigCli;
|
||||||
use label_cli::LabelCli;
|
use label_cli::LabelCli;
|
||||||
use message_cli::MessageCli;
|
use message_cli::MessageCli;
|
||||||
use run_cli::RunCli;
|
use rules_cli::RulesCli;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[clap(author, version, about, long_about = None)]
|
#[clap(author, version, about, long_about = None)]
|
||||||
@@ -39,7 +39,7 @@ enum SubCmds {
|
|||||||
Labels(LabelCli),
|
Labels(LabelCli),
|
||||||
/// Run the rules from the rules configuration
|
/// Run the rules from the rules configuration
|
||||||
#[clap(name = "run", display_order = 6, next_help_heading = "Rule Processing")]
|
#[clap(name = "run", display_order = 6, next_help_heading = "Rule Processing")]
|
||||||
Run(RunCli),
|
Rules(RulesCli),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -75,7 +75,7 @@ async fn run(args: Cli) -> Result<()> {
|
|||||||
SubCmds::Config(config_cli) => config_cli.run(config),
|
SubCmds::Config(config_cli) => config_cli.run(config),
|
||||||
SubCmds::Message(list_cli) => list_cli.run(&mut client).await,
|
SubCmds::Message(list_cli) => list_cli.run(&mut client).await,
|
||||||
SubCmds::Labels(label_cli) => label_cli.run(client).await,
|
SubCmds::Labels(label_cli) => label_cli.run(client).await,
|
||||||
SubCmds::Run(run_cli) => run_cli.run(&mut client, config).await,
|
SubCmds::Rules(run_cli) => run_cli.run(&mut client, config).await,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use clap::Parser;
|
|||||||
use cull_gmail::{Config, EolAction, GmailClient, Result, RuleProcessor};
|
use cull_gmail::{Config, EolAction, GmailClient, Result, RuleProcessor};
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct RunCli {
|
pub struct RulesCli {
|
||||||
/// Execute the action
|
/// Execute the action
|
||||||
#[clap(short, long, display_order = 1, help_heading = "Action")]
|
#[clap(short, long, display_order = 1, help_heading = "Action")]
|
||||||
execute: bool,
|
execute: bool,
|
||||||
@@ -14,7 +14,7 @@ pub struct RunCli {
|
|||||||
skip_delete: bool,
|
skip_delete: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RunCli {
|
impl RulesCli {
|
||||||
pub async fn run(&self, client: &mut GmailClient, config: Config) -> Result<()> {
|
pub async fn run(&self, client: &mut GmailClient, config: Config) -> Result<()> {
|
||||||
let rules = config.get_rules_by_label();
|
let rules = config.get_rules_by_label();
|
||||||
|
|
||||||
Reference in New Issue
Block a user