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
@@ -6,7 +6,7 @@ use tracing::info;
use crate::{
account::arg::name::AccountNameFlag,
backend::Backend,
config::TomlConfig,
config::Config,
envelope::arg::ids::EnvelopeIdsArgs,
folder::arg::name::{SourceFolderNameOptionalFlag, TargetFolderNameArg},
printer::Printer,
@@ -29,7 +29,7 @@ pub struct MessageCopyCommand {
}
impl MessageCopyCommand {
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 copy message(s) command");
let source = &self.source_folder.name;
+2 -2
View File
@@ -4,7 +4,7 @@ use email::backend::feature::BackendFeatureSource;
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
envelope::arg::ids::EnvelopeIdsArgs, folder::arg::name::FolderNameOptionalFlag,
printer::Printer,
};
@@ -28,7 +28,7 @@ pub struct MessageDeleteCommand {
}
impl MessageDeleteCommand {
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 message(s) 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,
envelope::arg::ids::EnvelopeIdArg,
folder::arg::name::FolderNameOptionalFlag,
message::arg::{body::MessageRawBodyArg, header::HeaderRawArgs},
@@ -39,7 +39,7 @@ pub struct MessageForwardCommand {
}
impl MessageForwardCommand {
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 forward message command");
let folder = &self.folder.name;
+2 -2
View File
@@ -6,7 +6,7 @@ use tracing::info;
use url::Url;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig, printer::Printer,
account::arg::name::AccountNameFlag, backend::Backend, config::Config, printer::Printer,
ui::editor,
};
@@ -34,7 +34,7 @@ impl MessageMailtoCommand {
})
}
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 mailto message command");
let (toml_account_config, account_config) = config
+2 -2
View File
@@ -13,7 +13,7 @@ pub mod write;
use clap::Subcommand;
use color_eyre::Result;
use crate::{config::TomlConfig, printer::Printer};
use crate::{config::Config, printer::Printer};
use self::{
copy::MessageCopyCommand, delete::MessageDeleteCommand, forward::MessageForwardCommand,
@@ -67,7 +67,7 @@ pub enum MessageSubcommand {
impl MessageSubcommand {
#[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::Read(cmd) => cmd.execute(printer, config).await,
Self::Thread(cmd) => cmd.execute(printer, config).await,
+2 -2
View File
@@ -7,7 +7,7 @@ use tracing::info;
use crate::{
account::arg::name::AccountNameFlag,
backend::Backend,
config::TomlConfig,
config::Config,
envelope::arg::ids::EnvelopeIdsArgs,
folder::arg::name::{SourceFolderNameOptionalFlag, TargetFolderNameArg},
printer::Printer,
@@ -30,7 +30,7 @@ pub struct MessageMoveCommand {
}
impl MessageMoveCommand {
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 move message(s) command");
let source = &self.source_folder.name;
+2 -2
View File
@@ -6,7 +6,7 @@ use tracing::info;
#[allow(unused)]
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
envelope::arg::ids::EnvelopeIdsArgs, folder::arg::name::FolderNameOptionalFlag,
printer::Printer,
};
@@ -73,7 +73,7 @@ pub struct MessageReadCommand {
}
impl MessageReadCommand {
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 read message(s) 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,
envelope::arg::ids::EnvelopeIdArg,
folder::arg::name::FolderNameOptionalFlag,
message::arg::{body::MessageRawBodyArg, header::HeaderRawArgs, reply::MessageReplyAllArg},
@@ -42,7 +42,7 @@ pub struct MessageReplyCommand {
}
impl MessageReplyCommand {
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 reply message command");
let folder = &self.folder.name;
+2 -2
View File
@@ -6,7 +6,7 @@ use tracing::info;
#[allow(unused)]
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
folder::arg::name::FolderNameOptionalFlag, message::arg::MessageRawArg, printer::Printer,
};
@@ -26,7 +26,7 @@ pub struct MessageSaveCommand {
}
impl MessageSaveCommand {
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 save message command");
let folder = &self.folder.name;
+2 -2
View File
@@ -5,7 +5,7 @@ use std::io::{self, BufRead, IsTerminal};
use tracing::info;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
message::arg::MessageRawArg, printer::Printer,
};
@@ -23,7 +23,7 @@ pub struct MessageSendCommand {
}
impl MessageSendCommand {
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 send message command");
let (toml_account_config, account_config) = config
+2 -2
View File
@@ -7,7 +7,7 @@ use tracing::info;
use crate::envelope::arg::ids::EnvelopeIdArg;
#[allow(unused)]
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
account::arg::name::AccountNameFlag, backend::Backend, config::Config,
envelope::arg::ids::EnvelopeIdsArgs, folder::arg::name::FolderNameOptionalFlag,
printer::Printer,
};
@@ -74,7 +74,7 @@ pub struct MessageThreadCommand {
}
impl MessageThreadCommand {
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 thread message(s) 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,
message::arg::{body::MessageRawBodyArg, header::HeaderRawArgs},
printer::Printer,
ui::editor,
@@ -31,7 +31,7 @@ pub struct MessageWriteCommand {
}
impl MessageWriteCommand {
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 write message command");
let (toml_account_config, account_config) = config