https://github.com/queer/decompressor
c the automagic de(c)ompressor
https://github.com/queer/decompressor
Last synced: 11 months ago
JSON representation
c the automagic de(c)ompressor
- Host: GitHub
- URL: https://github.com/queer/decompressor
- Owner: queer
- Archived: true
- Created: 2023-01-22T20:57:45.000Z (over 3 years ago)
- Default Branch: mistress
- Last Pushed: 2024-01-09T12:59:52.000Z (over 2 years ago)
- Last Synced: 2025-07-04T15:23:00.531Z (11 months ago)
- Language: Rust
- Homepage:
- Size: 71.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# de(c)ompressor
the de(c)ompressor operates on streams compression streams automagically. input
streams are detected by magic numbers, output streams are determined by cli
flags (or decompress to plain text if none given).
## supported compression formats
- plain text
- brotli
- deflate
- gzip
- xz
- zlib
- zstd
## example usage
```bash
$ echo "this is a test" | gzip | c
# this is a test
```
```bash
$ echo "this is a test" | gzip | c -o brotli | brotli -c -d
# this is a test
```
```bash
# brotli cannot be autodetected, so hint it
$ echo "this is a test" | brotli -c | c brotli
# this is a test
# without hint: `�%R�B�[d��`
```
## help
```bash
git:(mistress) | ▶ c --help
Usage: c [OPTIONS] [HINT]
Arguments:
[HINT] Hint for the compression type, e.g. `brotli` [default: unknown]
Options:
-q, --quiet
-o, --output-type Force the output to be compressed with the given type, e.g. `brotli` [default: none] [possible values: zstd, brotli, gzip, deflate, zlib, xz, none]
-h, --help Print help
git:(mistress) | ▶
```
de(c)ompressor must be run via stdin/out pipes, otherwise it will fail:
```bash
git:(mistress) 7 | ▶ c
Error:
0: input is a terminal, please pipe data via stdin!
Location:
src/main.rs:36
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
git:(mistress) | ▶
```