From 784217143a475de3d12b8caa47d381994b2627b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Miguel?= Date: Tue, 6 Apr 2021 19:05:36 -0300 Subject: [PATCH] Better error message for MissingArgumentsForDecompression --- src/error.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 6d1c547..3b7c3e0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -66,7 +66,10 @@ impl fmt::Display for Error { } Error::MissingArgumentsForCompression => { write!(f, "{} ", "[ERROR]".red())?; - write!(f,"The compress subcommands demands at least 2 arguments, see usage: ") + let spacing = " "; + writeln!(f,"The compress subcommands demands at least 2 arguments, an input file and an output file.")?; + writeln!(f,"{}Example: `ouch compress img.jpeg img.zip", spacing)?; + write!(f,"{}For more information, run `ouch --help`", spacing) } Error::InternalError => { write!(f, "{} ", "[ERROR]".red())?;