Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to specify --compression-level "22" when using --compression "zstd" #54

@Azathothas

Description

@Azathothas

Hi, I built a version with --all-features

$ bita compress --help
Compress a file or stream

Usage: bita compress [OPTIONS] <OUTPUT>

Arguments:
  <OUTPUT>  Output file

Options:
  -i, --input <FILE>                  Input file, if none is given stdin is used
  -v...                               Set verbosity level
  -f, --force-create                  Overwrite output files if they exist
      --buffered-chunks <COUNT>       Limit number of chunks processed simultaneously [default: CPU cores x 2]
      --metadata-file <KEY> <PATH>    Custom metadata key-value pair where the value is a file contents
      --metadata-value <KEY> <VALUE>  Custom metadata key-value pair where the value is a provided string
      --avg-chunk-size <SIZE>         Indication of target chunk size [default: 64KiB]
      --min-chunk-size <SIZE>         Set minimal size of chunks [default: 16KiB]
      --max-chunk-size <SIZE>         Set maximal size of chunks [default: 16MiB]
      --hash-chunking <HASH>          Set hash to use for chunking [default: RollSum] [possible values: RollSum, BuzHash]
      --rolling-window-size <SIZE>    Set size of the rolling hash window to use for chunking [default: 64B]
      --fixed-size <SIZE>             Use fixed size chunking instead of rolling hash
      --compression-level <LEVEL>     Set the chunk data compression level [default: 6]
      --compression <TYPE>            Set the chunk data compression type [default: brotli] [possible values: brotli, lzma, zstd, none]
      --hash-length <LENGTH>          Truncate the length of the stored chunk hash [default: 64]
  -h, --help                          Print help

However, it won't let me specify the maximum compression of 22 for zstd

$ bita compress --input "x86_64-Linux.json" --compression "zstd" --compression-level "22" --force-create "x86_64-Linux.json.cba"
error: invalid value '22' for '--compression-level <LEVEL>': 22 is not in 1..22

For more information, try '--help'.

21 works

$ bita compress --input "x86_64-Linux.json" --compression "zstd" --compression-level "21" --force-create "x86_64-Linux.json.cba"
Archive:
  Built with version: 0.12.0
  Archive size: 128.3 KiB (131344 bytes)
  Metadata: None
  Header checksum: c54c6831c8df43f127cf9fa7fc8fa36c0dc5cd6fddc4d5c6a5e1251197b1a4f44f96a3abca19abc9f33fd644084c50a12c68cc55bb1a0e9e75b3cf4324fc46a0
  Chunk hash length: 64 bytes
  Chunk compression: zstd (level 21)
  Chunking algorithm: RollSum
  Rolling hash window size: 64 bytes
  Chunk minimum size: 16.0 KiB (16384 bytes)
  Chunk maximum size: 16.0 MiB (16777216 bytes)
  Chunk average target size: 64.0 KiB (65536 bytes) (mask: 0b111111111111111)
Source:
  Source checksum: cfdcce460e96536fad86572d2b864a38c46656d1052fdaf07395bd02474f8e9f91d57087389cbd33df60851baaa219effe59871b4e36fd42738f8a6a106dc601
  Chunks in source: 16 (unique: 16)
  Average chunk size: 94.7 KiB (96977 bytes)
  Source size: 1.5 MiB (1551641 bytes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions