♻️ refactor(cli): remove config from run args

- remove config from run args to load inside functions
- load credential.json directly instead of config file
This commit is contained in:
Jeremiah Russell
2025-10-15 13:47:25 +01:00
committed by Jeremiah Russell
parent 455007dd82
commit 5905a6fb54
4 changed files with 27 additions and 16 deletions

View File

@@ -57,15 +57,12 @@ async fn main() {
}
async fn run(args: Cli) -> Result<()> {
let config = get_config()?;
log::trace!("Configuration loaded: {config:#?}");
let mut client = GmailClient::new(config.credential_file()).await?;
let mut client = GmailClient::new("credential.json").await?;
match args.sub_command {
SubCmds::Message(messages_cli) => messages_cli.run(&mut client).await,
SubCmds::Labels(labels_cli) => labels_cli.run(client).await,
SubCmds::Rules(rules_cli) => rules_cli.run(&mut client, config).await,
SubCmds::Rules(rules_cli) => rules_cli.run(&mut client).await,
}
}