♻️ refactor(cli): rename list subcommand to message
- rename list_cli module to message_cli - rename ListCli struct to MessageCli - update the command name from list to message
This commit is contained in:
committed by
Jeremiah Russell
parent
3c94da389f
commit
57ddb8da90
10
src/main.rs
10
src/main.rs
@@ -1,11 +1,11 @@
|
|||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
mod label_cli;
|
mod label_cli;
|
||||||
mod list_cli;
|
mod message_cli;
|
||||||
|
|
||||||
use cull_gmail::Error;
|
use cull_gmail::Error;
|
||||||
use label_cli::LabelCli;
|
use label_cli::LabelCli;
|
||||||
use list_cli::ListCli;
|
use message_cli::MessageCli;
|
||||||
use std::error::Error as stdError;
|
use std::error::Error as stdError;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
@@ -20,8 +20,8 @@ struct Cli {
|
|||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
enum Commands {
|
enum Commands {
|
||||||
/// List messages
|
/// List messages
|
||||||
#[clap(name = "list")]
|
#[clap(name = "message")]
|
||||||
List(ListCli),
|
Message(MessageCli),
|
||||||
/// List labels
|
/// List labels
|
||||||
#[clap(name = "label")]
|
#[clap(name = "label")]
|
||||||
Labels(LabelCli),
|
Labels(LabelCli),
|
||||||
@@ -53,7 +53,7 @@ async fn main() {
|
|||||||
async fn run(args: Cli) -> Result<(), Error> {
|
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::Message(list_cli) => list_cli.run("credential.json").await?,
|
||||||
Commands::Labels(label_cli) => label_cli.run("credential.json").await?,
|
Commands::Labels(label_cli) => label_cli.run("credential.json").await?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user