mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
parent
c8f97197c3
commit
c3b89b038d
@ -64,7 +64,7 @@ Categories Used:
|
|||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
- Fix logging IO bottleneck [\#642](https://github.com/ouch-org/ouch/pull/642) ([AntoniosBarotsis](https://github.com/AntoniosBarotsis))
|
- Fix logging IO bottleneck [\#642](https://github.com/ouch-org/ouch/pull/642) ([AntoniosBarotsis](https://github.com/AntoniosBarotsis))
|
||||||
- Support decompression over stdin [\#692](https://github.com/ouch-org/ouch/pull/692) ([rcorre](https://github.com/rcorre))
|
- Support decompression over stdin [\#692](https://github.com/ouch-org/ouch/pull/692) ([rcorre](https://github.com/rcorre))
|
||||||
- Make `--format` more forgiving with the formatting of the provided format [\#519](https://github.com/ouch-org/ouch/pull/519) ([marcospb19](https://github.com/marcospb19))
|
- Make `--format` more forgiving with the formatting of the provided format [\#519](https://github.com/ouch-org/ouch/pull/519) ([marcospb19](https://github.com/marcospb19))
|
||||||
- Use buffered writer for list output [\#764](https://github.com/ouch-org/ouch/pull/764) ([killercup](https://github.com/killercup))
|
- Use buffered writer for list output [\#764](https://github.com/ouch-org/ouch/pull/764) ([killercup](https://github.com/killercup))
|
||||||
- Disable smart unpack when `--dir` flag is provided in decompress command [\#782](https://github.com/ouch-org/ouch/pull/782) ([talis-fb](https://github.com/talis-fb))
|
- Disable smart unpack when `--dir` flag is provided in decompress command [\#782](https://github.com/ouch-org/ouch/pull/782) ([talis-fb](https://github.com/talis-fb))
|
||||||
|
@ -203,24 +203,23 @@ pub fn separate_known_extensions_from_name(path: &Path) -> Result<(&Path, Vec<Ex
|
|||||||
extensions.insert(0, extension);
|
extensions.insert(0, extension);
|
||||||
if extensions[0].is_archive() {
|
if extensions[0].is_archive() {
|
||||||
if let Some((_, misplaced_extension)) = split_extension_at_end(name) {
|
if let Some((_, misplaced_extension)) = split_extension_at_end(name) {
|
||||||
return Err(FinalError::with_title("File extensions are invalid for operation")
|
let mut error = FinalError::with_title("File extensions are invalid for operation").detail(format!(
|
||||||
.detail(format!(
|
"The archive extension '.{}' can only be placed at the start of the extension list",
|
||||||
"The archive extension '.{}' must come before any non-archive extensions, like '.{}'",
|
extensions[0].display_text,
|
||||||
extensions[0].display_text, misplaced_extension.display_text
|
));
|
||||||
))
|
|
||||||
.detail(format!(
|
if misplaced_extension.compression_formats == extensions[0].compression_formats {
|
||||||
|
error = error.detail(format!(
|
||||||
"File: '{path:?}' contains '.{}' and '.{}'",
|
"File: '{path:?}' contains '.{}' and '.{}'",
|
||||||
misplaced_extension.display_text, extensions[0].display_text,
|
misplaced_extension.display_text, extensions[0].display_text,
|
||||||
))
|
));
|
||||||
.detail(format!("'.{}' is an archive format", extensions[0].display_text))
|
}
|
||||||
.detail(format!(
|
|
||||||
"'.{}' isn't an archive format",
|
return Err(error
|
||||||
misplaced_extension.display_text
|
|
||||||
))
|
|
||||||
.hint("You can use `--format` to specify what format to use, examples:")
|
.hint("You can use `--format` to specify what format to use, examples:")
|
||||||
.hint(" ouch compress 1 2 file --format zip")
|
.hint(" ouch compress file.zip.zip file --format zip")
|
||||||
.hint(" ouch decompress file --format gz")
|
.hint(" ouch decompress file --format zst")
|
||||||
.hint(" ouch list archive --format zip")
|
.hint(" ouch list archive --format tar.gz")
|
||||||
.into());
|
.into());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user