feat: better confirmation before deleting
This commit is contained in:
parent
a00ed50836
commit
348201e19a
10
src/main.rs
10
src/main.rs
|
@ -36,12 +36,12 @@ fn confirm_parse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn confirm_once() {
|
fn confirm_once() {
|
||||||
print!("Are you sure you want to delete the specified targets? [y/N]: ");
|
print!("Delete the specified targets? [y/N]: ");
|
||||||
confirm_parse();
|
confirm_parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn confirm_each(target: &String) {
|
fn confirm_each(target: &String) {
|
||||||
print!("Are you sure you want to delete {} ? [y/N]: ", target.bold());
|
print!("Delete {} ? [y/N]: ", target.bold());
|
||||||
confirm_parse();
|
confirm_parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,10 +58,14 @@ fn vaporise() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.ask_once {
|
if args.ask_once {
|
||||||
|
println!();
|
||||||
|
for target in args.targets.iter() {
|
||||||
|
println!(" {}", target.bold());
|
||||||
|
}
|
||||||
|
println!();
|
||||||
confirm_once();
|
confirm_once();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let root: &str;
|
let root: &str;
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
root = "C:\\";
|
root = "C:\\";
|
||||||
|
|
Loading…
Reference in a new issue