From 4bb759b21ccd1f6b7f5ac4c2831e5406961d1992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20P=2E=20Bezerra?= Date: Sun, 17 Nov 2024 23:44:33 -0300 Subject: [PATCH] tweak: improve error message in case the user is trying to decompress a file with no filestem, just the extension, which is confusing --- src/check.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/check.rs b/src/check.rs index 7face917..bcad3cff 100644 --- a/src/check.rs +++ b/src/check.rs @@ -35,10 +35,9 @@ pub fn check_mime_type( if let Some(detected_format) = try_infer_extension(path) { // Inferring the file extension can have unpredicted consequences (e.g. the user just // mistyped, ...) which we should always inform the user about. - info_accessible(format!( - "Detected file: `{}` extension as `{}`", + warning(format!( + "We detected a file named `{}`, do you want to decompress it?", path.display(), - detected_format )); if user_wants_to_continue(path, question_policy, QuestionAction::Decompression)? {