mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
chore: revert user_wants_to_continue
This commit is contained in:
parent
e2e28b008f
commit
44e80d2df3
@ -116,17 +116,14 @@ pub fn user_wants_to_continue(
|
|||||||
QuestionPolicy::AlwaysYes => Ok(true),
|
QuestionPolicy::AlwaysYes => Ok(true),
|
||||||
QuestionPolicy::AlwaysNo => Ok(false),
|
QuestionPolicy::AlwaysNo => Ok(false),
|
||||||
QuestionPolicy::Ask => {
|
QuestionPolicy::Ask => {
|
||||||
let path = path_to_str(strip_cur_dir(path));
|
|
||||||
let action = match question_action {
|
let action = match question_action {
|
||||||
QuestionAction::Compression => "compress",
|
QuestionAction::Compression => "compress",
|
||||||
QuestionAction::Decompression => "decompress",
|
QuestionAction::Decompression => "decompress",
|
||||||
};
|
};
|
||||||
|
let path = path_to_str(strip_cur_dir(path));
|
||||||
ChoicePrompt::new(
|
let path = Some(&*path);
|
||||||
format!("Do you want to {action} {path}?"),
|
let placeholder = Some("FILE");
|
||||||
[("yes", true, *colors::GREEN), ("no", false, *colors::RED)],
|
Confirmation::new(&format!("Do you want to {action} 'FILE'?"), placeholder).ask(path)
|
||||||
)
|
|
||||||
.ask()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user