···11# cmprss
2233-**Status: Pre-alpha.**
44-Lacks formal testing.
55-CLI is reasonably stable but still being tweaked.
33+**Status: Alpha.**
44+CLI is stable but likely contains bugs, and may have breaking changes.
6577-A compression multi-tool for the CLI. Replace `tar` with something you can remember. [Relevant XKCD](https://xkcd.com/1168/).
66+A compression multi-tool for the CLI.
77+Replace `tar` with something you can remember.
88+[Relevant XKCD](https://xkcd.com/1168/).
89910## Usage
10111112The primary goal of the CLI is to make it easy and consistent to work with any compression format.
1213All of the examples will work with _any_ of the supported compression formats.
1313-Some formats will fail in certain scenarios, as they don't support certain types of input/output; for example `tar` is unable to support compressing from `stdin` and extracting to `stdout`.
1414+Some formats will fail in certain scenarios, as not all compression formats support all types of input/output; for example `tar` is unable to support compressing from `stdin` and extracting to `stdout`, because it expects to operate on files.
14151515-All commands read from left to right, input is always either piped from `stdin` or the first filename specified, and output is either `stdout` or the next filename (the first if using `stdin`, the second if using a filename for input).
1616+All commands read from left to right, input is always either piped from `stdin` or the first filename(s) specified, and output is either `stdout` or the last filename/directory.
16171718If output filenames are left out, `cmprss` will try to infer the filename based on the compression type.
1819···20212122Compress a file/directory to a `tar` archive:
22232424+```bash
2525+cmprss tar filename # outputs to archive.tar
2626+cmprss tar filename my_preferred_output_name.tar
2327```
2424-cmprss tar filename
2525-cmprss tar filename my_preferred_output_name.tar
2828+2929+Compress 2 files/directories into a `tar` archive:
3030+3131+```bash
3232+cmprss tar dir_1/ dir_2/ combined.tar
3333+cmprss tar file_1.txt file_2.txt # outputs to archive.tar
2634```
27352836Extract a `tar` archive:
29373030-```
3131-cmprss tar --extract filename.tar
3232-cmprss tar --extract filename.tar custom_output_directory
3838+```bash
3939+cmprss tar --extract archive.tar # extracts to the current directory
4040+cmprss tar -e archive.tar custom_output_directory
3341```
34423535-`cmprss` will detect if `stdin` or `stdout` is a pipe, and use those for I/O.
4343+`cmprss` will detect if `stdin` or `stdout` is a pipe, and use those for I/O where it makes sense.
36443745Create and extract a `tar.gz` archive with pipes:
38463939-```
4747+```bash
4048cmprss tar directory_name | cmprss gzip > directory.tar.gz
4149cmprss gzip --extract directory.tar.gz | cmprss tar --extract new_directory
5050+5151+# Or a full roundtrip in one line
5252+cmprss tar directory_1/ directory_2/ | cmprss gzip | cmprss gzip -e | cmprss tar -e new_directory
4253```
43544455## Supported formats
45564657- gzip
4758- tar
4848-4949-TODO: Add more compression algos now that the internal API is mostly stable.