✨ 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:
committed by
Jeremiah Russell
parent
3f50a74756
commit
0fa5a21434
@@ -1,8 +1,10 @@
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
mod label_cli;
|
||||
mod list_cli;
|
||||
|
||||
use cull_gmail::Error;
|
||||
use label_cli::LabelCli;
|
||||
use list_cli::ListCli;
|
||||
use std::error::Error as stdError;
|
||||
|
||||
@@ -20,6 +22,9 @@ enum Commands {
|
||||
/// List messages
|
||||
#[clap(name = "list")]
|
||||
List(ListCli),
|
||||
/// List labels
|
||||
#[clap(name = "label")]
|
||||
Labels(LabelCli),
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -49,6 +54,7 @@ async fn run(args: Cli) -> Result<(), Error> {
|
||||
if let Some(cmds) = args.command {
|
||||
match cmds {
|
||||
Commands::List(list_cli) => list_cli.run("credential.json").await?,
|
||||
Commands::Labels(label_cli) => label_cli.run("credential.json").await?,
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user