feat(cli): add label listing subcommand

- implement new `label` subcommand to list available Gmail labels
- create `label_cli` module to handle label listing logic
- integrate label listing into the main CLI application
This commit is contained in:
Jeremiah Russell
2025-10-03 17:37:16 +01:00
committed by Jeremiah Russell
parent 3f50a74756
commit 0fa5a21434

View File

@@ -1,8 +1,10 @@
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
mod label_cli;
mod list_cli; mod list_cli;
use cull_gmail::Error; use cull_gmail::Error;
use label_cli::LabelCli;
use list_cli::ListCli; use list_cli::ListCli;
use std::error::Error as stdError; use std::error::Error as stdError;
@@ -20,6 +22,9 @@ enum Commands {
/// List messages /// List messages
#[clap(name = "list")] #[clap(name = "list")]
List(ListCli), List(ListCli),
/// List labels
#[clap(name = "label")]
Labels(LabelCli),
} }
#[tokio::main] #[tokio::main]
@@ -49,6 +54,7 @@ async fn run(args: Cli) -> Result<(), Error> {
if let Some(cmds) = args.command { if let Some(cmds) = args.command {
match cmds { match cmds {
Commands::List(list_cli) => list_cli.run("credential.json").await?, Commands::List(list_cli) => list_cli.run("credential.json").await?,
Commands::Labels(label_cli) => label_cli.run("credential.json").await?,
} }
} }
Ok(()) Ok(())