♻️ refactor(cli): rename list_cli to message_cli
- rename `ListCli` struct to `MessageCli` - rename `List` struct to `Message` - reflect changes in file names and imports
This commit is contained in:
committed by
Jeremiah Russell
parent
24318768c8
commit
3c94da389f
@@ -1,9 +1,9 @@
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use cull_gmail::{Error, Labels, List};
|
use cull_gmail::{Error, Labels, Message};
|
||||||
|
|
||||||
/// Command line options for the list subcommand
|
/// Command line options for the list subcommand
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct ListCli {
|
pub struct MessageCli {
|
||||||
/// Maximum results per page
|
/// Maximum results per page
|
||||||
#[arg(short, long, default_value = cull_gmail::DEFAULT_MAX_RESULTS)]
|
#[arg(short, long, default_value = cull_gmail::DEFAULT_MAX_RESULTS)]
|
||||||
max_results: u32,
|
max_results: u32,
|
||||||
@@ -18,9 +18,9 @@ pub struct ListCli {
|
|||||||
query: Option<String>,
|
query: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ListCli {
|
impl MessageCli {
|
||||||
pub(crate) async fn run(&self, credential_file: &str) -> Result<(), Error> {
|
pub(crate) async fn run(&self, credential_file: &str) -> Result<(), Error> {
|
||||||
let mut list = List::new(credential_file).await?;
|
let mut list = Message::new(credential_file).await?;
|
||||||
|
|
||||||
if !self.labels.is_empty() {
|
if !self.labels.is_empty() {
|
||||||
// add labels if any specified
|
// add labels if any specified
|
||||||
Reference in New Issue
Block a user