mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
error: add MissingArgumentsForDecompression
This commit is contained in:
parent
990458b771
commit
40410840c9
@ -125,7 +125,7 @@ pub fn parse_args_from(mut args: Vec<OsString>) -> crate::Result<ParsedArgs> {
|
||||
return Err(Error::CompressionTypo);
|
||||
}
|
||||
} else {
|
||||
todo!("Complain that no decompression arguments were given.");
|
||||
return Err(Error::MissingArgumentsForDecompression);
|
||||
}
|
||||
|
||||
// Parse flags
|
||||
|
12
src/error.rs
12
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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user