From 21134aaeff62ee13df9f2f64eb7bf63d92665ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Tue, 2 Nov 2021 06:28:55 -0300 Subject: [PATCH] Improve message when no extensions given to compress file --- src/commands.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 8883ceb..be9cea1 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -45,12 +45,13 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> { if formats.is_empty() { let error = FinalError::with_title(format!("Cannot compress to '{}'.", to_utf(&output_path))) - .detail("You shall supply the compression format via the extension.") - .hint("Try adding something like .tar.gz or .zip to the output file.") + .detail("You shall supply the compression format") + .hint("Try adding supported extensions (see --help):") + .hint(format!(" ouch compress ... {}.tar.gz", to_utf(&output_path))) + .hint(format!(" ouch compress ... {}.zip", to_utf(&output_path))) .hint("") - .hint("Examples:") - .hint(format!(" ouch compress ... {}.tar.gz", to_utf(&output_path))) - .hint(format!(" ouch compress ... {}.zip", to_utf(&output_path))); + .hint("Alternatively, you can overwrite this option by using the '--format' flag:") + .hint(format!(" ouch compress ... {} --format tar.gz", to_utf(&output_path))); return Err(error.into()); }