make use of pimalaya_tui::config::TomlConfig

This commit is contained in:
Clément DOUIN
2024-09-01 13:46:56 +02:00
parent 6f5f943875
commit b92d7b4a08
46 changed files with 205 additions and 308 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ use email::{backend::feature::BackendFeatureSource, folder::add::AddFolder};
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
folder::arg::name::FolderNameArg, printer::Printer,
};
@@ -22,7 +22,7 @@ pub struct AddFolderCommand {
}
impl AddFolderCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing create folder command");
let folder = &self.folder.name;
+2 -2
View File
@@ -7,7 +7,7 @@ use pimalaya_tui::prompt;
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
folder::arg::name::FolderNameArg, printer::Printer,
};
@@ -25,7 +25,7 @@ pub struct FolderDeleteCommand {
}
impl FolderDeleteCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing delete folder command");
let folder = &self.folder.name;
+2 -2
View File
@@ -4,7 +4,7 @@ use email::{backend::feature::BackendFeatureSource, folder::expunge::ExpungeFold
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
folder::arg::name::FolderNameArg, printer::Printer,
};
@@ -23,7 +23,7 @@ pub struct FolderExpungeCommand {
}
impl FolderExpungeCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing expunge folder command");
let folder = &self.folder.name;
+2 -2
View File
@@ -6,7 +6,7 @@ use tracing::info;
use crate::{
account::arg::name::AccountNameFlag,
backend::Backend,
config::TomlConfig,
config::Config,
folder::{Folders, FoldersTable},
printer::Printer,
};
@@ -29,7 +29,7 @@ pub struct FolderListCommand {
}
impl FolderListCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing list folders command");
let (toml_account_config, account_config) = config
+3 -3
View File
@@ -4,10 +4,10 @@ mod expunge;
mod list;
mod purge;
use color_eyre::Result;
use clap::Subcommand;
use color_eyre::Result;
use crate::{config::TomlConfig, printer::Printer};
use crate::{config::Config, printer::Printer};
use self::{
add::AddFolderCommand, delete::FolderDeleteCommand, expunge::FolderExpungeCommand,
@@ -38,7 +38,7 @@ pub enum FolderSubcommand {
impl FolderSubcommand {
#[allow(unused)]
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
match self {
Self::Add(cmd) => cmd.execute(printer, config).await,
Self::List(cmd) => cmd.execute(printer, config).await,
+2 -2
View File
@@ -7,7 +7,7 @@ use pimalaya_tui::prompt;
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
folder::arg::name::FolderNameArg, printer::Printer,
};
@@ -25,7 +25,7 @@ pub struct FolderPurgeCommand {
}
impl FolderPurgeCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
pub async fn execute(self, printer: &mut impl Printer, config: &Config) -> Result<()> {
info!("executing purge folder command");
let folder = &self.folder.name;