diff --git a/src/cli.rs b/src/cli.rs index 0cde41f..9ff64c6 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -125,7 +125,7 @@ pub fn parse_args_from(mut args: Vec) -> crate::Result { return Err(Error::CompressionTypo); } } else { - todo!("Complain that no decompression arguments were given."); + return Err(Error::MissingArgumentsForDecompression); } // Parse flags diff --git a/src/error.rs b/src/error.rs index 0169fed..45beaae 100644 --- a/src/error.rs +++ b/src/error.rs @@ -27,6 +27,7 @@ pub enum Error { OofError(oof::OofError), CompressingRootFolder, MissingArgumentsForCompression, + MissingArgumentsForDecompression, CompressionTypo, WalkdirError { reason: String }, } @@ -130,6 +131,17 @@ impl fmt::Display for Error { error } + Error::MissingArgumentsForDecompression => { + let error = FinalError::with_title("Could not decompress") + .detail("The compress command requires at least one argument") + .hint("You must provide:") + .hint(" - At least one input argument.") + .hint("") + .hint("Example: `ouch decompress imgs.tar.gz`") + .to_owned(); + + error + } Error::InternalError => { let error = FinalError::with_title("InternalError :(") .detail("This should not have happened")