Files
himalaya/src/sendmail/wizard.rs
T
Perma Alesheikh 5a0ff83a5e replace anyhow and log with color_eyre and tracing
Since Himalaya is intended to be ran as a CLI in the terminal emulator
environment, their user experience could vastly improve with better and
more colorful error messages and logging.

This change will replace more minimal libraries for error-reporting/han-
dling with their more advanced counterparts.

Since these crates have tight integrations, this commit will change both
in one shot.

Also we have don't need env_logger any more. So I also have removed that
guy as well.

Signed-off-by: Perma Alesheikh <me@prma.dev>
2024-04-15 12:17:56 +02:00

18 lines
502 B
Rust

use color_eyre::Result;
use dialoguer::Input;
use email::sendmail::config::SendmailConfig;
use crate::{backend::config::BackendConfig, ui::THEME};
pub(crate) fn configure() -> Result<BackendConfig> {
let config = SendmailConfig {
cmd: Input::with_theme(&*THEME)
.with_prompt("Sendmail-compatible shell command to send emails")
.default(String::from("/usr/bin/msmtp"))
.interact()?
.into(),
};
Ok(BackendConfig::Sendmail(config))
}