1 # ouch (_work in progress_)
3 `ouch` is the Obvious Unified Compression (_and decompression_) Helper.
6 | Supported formats | .tar | .zip | .tar.{.lz*,.gz, .bz} | .zip.{.lz*, .gz, .bz*} | .bz | .gz | .lz, .lzma |
7 |-------------------|------|------|------------------------------|------------------------------|-----|-----|------------|
8 | Decompression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
9 | Compression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
13 `ouch` infers commands from the extensions of its command-line options.
18 ouch is a unified compression & decompression utility
21 ouch [OPTIONS] --input <input>...
24 -h, --help Displays this message and exits
25 -V, --version Prints version information
28 -i, --input <input>... The input files or directories.
29 -o, --output <output> The output directory or compressed file.
34 #### Decompressing a bunch of files
37 $ ouch -i file{1..5}.zip another_file.tar.gz yet_another_file.tar.bz
40 When no output file is supplied, `ouch` infers that it must decompress all of its input files into the current folder. This will error if any of the input files are not decompressible.
42 #### Decompressing a bunch of files into a folder
45 $ ouch -i file{1..3}.tar.gz videos.tar.bz2 -o some-folder
46 # Decompresses file1.tar.gz, file2.tar.gz, file3.tar.gz and videos.tar.bz2 to some-folder
47 # The folder `ouch` saves to will be created if it doesn't already exist
50 When the output file is not a compressed file, `ouch` will check if all input files are decompressible and infer that it must decompress them into the output folder.
52 #### Compressing files
55 $ ouch -i file{1..20} -o archive.tar
56 $ ouch -i Videos/ Movies/ -o media.tar.lzma
57 $ ouch -i src/ Cargo.toml Cargo.lock -o my_project.tar.gz
62 #### No clear decompression algorithm
65 $ ouch -i some-file -o some-folder
66 error: file 'some-file' is not decompressible.
69 `ouch` cannot infer `some-file`'s compression format since it lacks an extension. Likewise, `ouch` cannot infer that the output file given is a compressed file, so it shows the user an error.
72 $ ouch -i file other-file -o files.gz
73 error: cannot compress multiple files directly to Gzip.
74 Try using an intermediate archival method such as Tar.
75 Example: filename.tar.gz
78 Similar errors are shown if the same scenario is applied to `.lz/.lzma` and `.bz/.bz2`.
82 ### Runtime dependencies
84 `ouch` depends on a few widespread libraries:
88 Both should be already installed in any mainstream Linux distribution.
92 * On Debian-based distros
94 `sudo apt install liblzma-dev libbz2-dev`
96 * On Arch-based distros
98 `sudo pacman -S xz bzip2`
100 The last dependency is a recent [Rust](https://www.rust-lang.org/) toolchain. If you don't have one installed, follow the instructions at [rustup.rs](https://rustup.rs/).
104 Once the dependency requirements are met:
106 * Installing from [Crates.io](https://crates.io)
112 * Cloning and building
115 git clone https://github.com/vrmiguel/ouch
116 cargo install --path ouch
118 cd ouch && cargo run --release
121 I also recommend stripping the release binary. `ouch`'s release binary (at the time of writing) only takes up a megabyte in space when stripped.
123 ## Supported operating systems
125 `ouch` _should_ be cross-platform but is currently only tested (and developed) on Linux, on both x64-64 and ARM.
129 `ouch` does encoding and decoding in-memory, so decompressing very large files with `ouch` is not advisable.
133 Any contributions and suggestions are welcome!