ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Allow bzip to use no compression with `--level 0`

Open marcospb19 opened this issue 2 years ago • 1 comments

Currently, Ouch accepts the range 1-9 for .bz.

https://github.com/ouch-org/ouch/blob/e0391a872be097f6d63f75a56d96e4344d3512e3/src/commands/compress.rs#L56

From the documentation of the lib we use:

Create a new compression spec with a specific numeric level (0-9).

We should be able to change the range to 0-9, accepting the level 0.

But allowing 0 breaks our tests for some reason:

thread 'single_file' panicked at 'Test failed: command="/home/marcospb19/ouch/target/debug/ouch" "-A" "c" "-l" "0" "/tmp/.tmp88verl/before/file" "/tmp/.tmp88verl/file.tar.bz" "--yes"
code=101
stdout=""
stderr=```
thread \'main\' panicked at \'assertion failed: `(left == right)`
  left: `-2`,
 right: `0`\', /home/marcospb19/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bzip2-0.4.4/src/mem.rs:123:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

; minimal failing input: input = _SingleFileArgs { ext: Directory(Tar), exts: [Bz], level: Some(0) }

marcospb19 avatar Mar 19 '23 19:03 marcospb19

upstream issue: https://github.com/alexcrichton/bzip2-rs/issues/84

figsoda avatar Mar 24 '23 01:03 figsoda