mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 21:37:55 +08:00
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:
committed by
Clément DOUIN
parent
d54dd6429e
commit
1e448e56eb
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user