mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-08 12:35:41 +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);
|
return Err(Error::CompressionTypo);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
todo!("Complain that no decompression arguments were given.");
|
return Err(Error::MissingArgumentsForDecompression);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse flags
|
// Parse flags
|
||||||
|
12
src/error.rs
12
src/error.rs
@ -27,6 +27,7 @@ pub enum Error {
|
|||||||
OofError(oof::OofError),
|
OofError(oof::OofError),
|
||||||
CompressingRootFolder,
|
CompressingRootFolder,
|
||||||
MissingArgumentsForCompression,
|
MissingArgumentsForCompression,
|
||||||
|
MissingArgumentsForDecompression,
|
||||||
CompressionTypo,
|
CompressionTypo,
|
||||||
WalkdirError { reason: String },
|
WalkdirError { reason: String },
|
||||||
}
|
}
|
||||||
@ -130,6 +131,17 @@ impl fmt::Display for Error {
|
|||||||
|
|
||||||
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 => {
|
Error::InternalError => {
|
||||||
let error = FinalError::with_title("InternalError :(")
|
let error = FinalError::with_title("InternalError :(")
|
||||||
.detail("This should not have happened")
|
.detail("This should not have happened")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user