mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
tweak: improve error message
in case the user is trying to decompress a file with no filestem, just the extension, which is confusing
This commit is contained in:
parent
639ef19fbc
commit
900b31ad3a
@ -35,10 +35,9 @@ pub fn check_mime_type(
|
|||||||
if let Some(detected_format) = try_infer_extension(path) {
|
if let Some(detected_format) = try_infer_extension(path) {
|
||||||
// Inferring the file extension can have unpredicted consequences (e.g. the user just
|
// Inferring the file extension can have unpredicted consequences (e.g. the user just
|
||||||
// mistyped, ...) which we should always inform the user about.
|
// mistyped, ...) which we should always inform the user about.
|
||||||
info_accessible(format!(
|
warning(format!(
|
||||||
"Detected file: `{}` extension as `{}`",
|
"We detected a file named `{}`, do you want to decompress it?",
|
||||||
path.display(),
|
path.display(),
|
||||||
detected_format
|
|
||||||
));
|
));
|
||||||
|
|
||||||
if user_wants_to_continue(path, question_policy, QuestionAction::Decompression)? {
|
if user_wants_to_continue(path, question_policy, QuestionAction::Decompression)? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user