replace dialoguer with inquire

In order to reduce our dependencies, we are replacing the dependencies
that use console_rs with those that use crossterm.

This commit will completely replace dialoguer with inquire.

Signed-off-by: Perma Alesheikh <me@prma.dev>
This commit is contained in:
Perma Alesheikh
2024-05-06 15:49:58 +03:30
committed by Clément DOUIN
parent d54dd6429e
commit 1e448e56eb
17 changed files with 441 additions and 543 deletions
+4 -7
View File
@@ -1,7 +1,7 @@
use clap::Parser;
use color_eyre::Result;
use dialoguer::Confirm;
use email::{backend::feature::BackendFeatureSource, folder::delete::DeleteFolder};
use inquire::Confirm;
use std::process;
use tracing::info;
@@ -35,12 +35,9 @@ impl FolderDeleteCommand {
let folder = &self.folder.name;
let confirm_msg = format!("Do you really want to delete the folder {folder}? All emails will be definitely deleted.");
let confirm = Confirm::new()
.with_prompt(confirm_msg)
.default(false)
.report(false)
.interact_opt()?;
let confirm = Confirm::new(&format!("Do you really want to delete the folder {folder}? All emails will be definitely deleted."))
.with_default(false).prompt_skippable()?;
if let Some(false) | None = confirm {
process::exit(0);
};
+4 -7
View File
@@ -1,6 +1,5 @@
use clap::Parser;
use color_eyre::Result;
use dialoguer::Confirm;
use email::{backend::feature::BackendFeatureSource, folder::purge::PurgeFolder};
use std::process;
use tracing::info;
@@ -35,12 +34,10 @@ impl FolderPurgeCommand {
let folder = &self.folder.name;
let confirm_msg = format!("Do you really want to purge the folder {folder}? All emails will be definitely deleted.");
let confirm = Confirm::new()
.with_prompt(confirm_msg)
.default(false)
.report(false)
.interact_opt()?;
let confirm = inquire::Confirm::new(&format!("Do you really want to purge the folder {folder}? All emails will be definitely deleted."))
.with_default(false)
.prompt_skippable()?;
if let Some(false) | None = confirm {
process::exit(0);
};