♻️ refactor(list): refactor list command to accept credential file
- update list command to accept credential file path - create gmail hub in list command
This commit is contained in:
committed by
Jeremiah Russell
parent
dc1a52e39b
commit
44c9220eb1
@@ -1,16 +1,13 @@
|
||||
use clap::Parser;
|
||||
use cull_gmail::List;
|
||||
use google_gmail1::{
|
||||
Gmail, hyper_rustls::HttpsConnector, hyper_util::client::legacy::connect::HttpConnector,
|
||||
};
|
||||
use cull_gmail::{Error, List};
|
||||
|
||||
/// Command line options for the list subcommand
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct ListCli {}
|
||||
|
||||
impl ListCli {
|
||||
pub(crate) async fn run(&self, hub: Gmail<HttpsConnector<HttpConnector>>) {
|
||||
let list = List::new(hub);
|
||||
list.run().await;
|
||||
pub(crate) async fn run(&self, credential_file: &str) -> Result<(), Error> {
|
||||
let list = List::new(credential_file).await?;
|
||||
list.run().await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user