this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: add usage examples

+40 -3
+40 -3
README.md
··· 1 1 # cmprss 2 2 3 - Status: pre-alpha 3 + **Status: Pre-alpha.** 4 + Lacks formal testing. 5 + CLI is reasonably stable but still being tweaked. 6 + 7 + A compression multi-tool for the CLI. Replace `tar` with something you can remember. [Relevant XKCD](https://xkcd.com/1168/). 8 + 9 + ## Usage 10 + 11 + The primary goal of the CLI is to make it easy and consistent to work with any compression format. 12 + All of the examples will work with _any_ of the supported compression formats. 13 + 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`. 14 + 15 + 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). 16 + 17 + If output filenames are left out, `cmprss` will try to infer the filename based on the compression type. 18 + 19 + ### Examples 20 + 21 + Compress a file/directory to a `tar` archive: 22 + 23 + ``` 24 + cmprss tar filename 25 + cmprss tar filename my_preferred_output_name.tar 26 + ``` 27 + 28 + Extract a `tar` archive: 29 + 30 + ``` 31 + cmprss tar --extract filename.tar 32 + cmprss tar --extract filename.tar custom_output_directory 33 + ``` 34 + 35 + `cmprss` will detect if `stdin` or `stdout` is a pipe, and use those for I/O. 4 36 5 - A compression multi-tool for the CLI. 37 + Create and extract a `tar.gz` archive with pipes: 6 38 7 - Currently supports basic operations on `tar` and `gzip` archives. 39 + ``` 40 + cmprss tar directory_name | cmprss gzip > directory.tar.gz 41 + cmprss gzip --extract directory.tar.gz | cmprss tar --extract new_directory 42 + ``` 8 43 9 44 ## Supported formats 10 45 11 46 - gzip 12 47 - tar 48 + 49 + TODO: Add more compression algos now that the internal API is mostly stable.