Readme revision (#102)

+ Added list of aliases to the README
This commit is contained in:
João Marcos Bezerra 2021-10-18 23:09:28 -03:00 committed by GitHub
parent 9d7c8a9abb
commit 765fb40ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

109
README.md
View File

@ -2,124 +2,97 @@
[![crates.io](https://img.shields.io/crates/v/ouch.svg?style=for-the-badge&logo=rust)](https://crates.io/crates/ouch) [![license](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge&logo=Open-Source-Initiative&logoColor=ffffff)](https://github.com/ouch-org/ouch/blob/main/LICENSE) [![crates.io](https://img.shields.io/crates/v/ouch.svg?style=for-the-badge&logo=rust)](https://crates.io/crates/ouch) [![license](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge&logo=Open-Source-Initiative&logoColor=ffffff)](https://github.com/ouch-org/ouch/blob/main/LICENSE)
<!-- ![ouch_image](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5ilNDTFZZ-Vy_ctm2YyAe8Yk0UT7lB2hIhg&usqp=CAU) --> `ouch` stands for **Obvious Unified Compression Helper**, it's a CLI tool to compress and decompress files.
`ouch` stands for **Obvious Unified Compression Helper**, and works on _Linux_, _Mac OS_ and _Windows_.
It is a CLI tool to compress and decompress files that aims on ease of usage.
<!-- TODO -->
<!-- - [Listing files](#Listing-the-elements-of-an-archive) -->
- [Features](#features)
- [Usage](#usage) - [Usage](#usage)
- [Decompressing](#decompressing)
- [Compressing](#compressing)
- [Installation](#installation) - [Installation](#installation)
- [Latest binary](#downloading-the-latest-binary)
- [Compiling from source](#installing-from-source-code)
- [Supported Formats](#supported-formats) - [Supported Formats](#supported-formats)
- [Contributing](#contributing) - [Contributing](#contributing)
## Features
1. Easy to use.
2. Automatic format detection.
3. Same syntax, various formats.
4. Encoding and decoding streams, it's fast. <!-- We should post benchmarks in our wiki and link them here -->
## Usage ## Usage
### Decompressing ### Decompressing
Run `ouch` and pass compressed files as arguments. Use the `decompress` subcommand and pass the files.
```sh ```sh
# Decompress 'a.zip' # Decompress one
ouch decompress a.zip ouch decompress a.zip
# Also works with the short version # Decompress multiple
ouch d a.zip ouch decompress a.zip b.tar.gz c.tar
# Decompress multiple files # Short alternative
ouch decompress a.zip b.tar.gz ouch d a.zip
``` ```
You can redirect the decompression results to a folder with the `-o/--output` flag. You can redirect the decompression results to another folder with the `-o/--output` flag.
```sh ```sh
# Create 'pictures' folder and decompress inside of it # Decompress 'summer_vacation.zip' inside of new folder 'pictures'
ouch decompress a.zip -o pictures ouch decompress summer_vacation.zip -o pictures
``` ```
### Compressing ### Compressing
Use the `compress` subcommand. Use the `compress` subcommand, pass the files and the **output file** at the end.
Accepts multiple files and folders, the **last** argument shall be the **output file**.
```sh ```sh
# Compress four files into 'archive.zip' # Compress four files/folders
ouch compress 1 2 3 4 archive.zip ouch compress 1 2 3 4 archive.zip
# Also works with the short version # Short alternative
ouch c 1 2 3 4 archive.zip ouch c file.txt file.zip
# Compress folder and video into 'videos.tar.gz' # Compress everything in the current folder again and again
ouch compress videos/ meme.mp4 videos.tar.gz ouch compress * everything.tar.gz.xz.bz.zst.gz.gz.gz.gz.gz
# Compress one file using 4 compression formats
ouch compress file.txt compressed.gz.xz.bz.zst
# Compress all the files in current folder
ouch compress * files.zip
``` ```
`ouch` checks for the extensions of the **output file** to decide which formats should be used. `ouch` checks for the extensions of the **output file** to decide which formats should be used.
<!-- ### Listing the elements of an archive
* **Upcoming feature**
```
# Shows the files and folders contained in videos.tar.xz
ouch list videos.tar.xz
``` -->
## Installation ## Installation
### Downloading the latest binary ### Downloading the latest binary
Download the script with `curl` and run it. Compiled for `x86_64` on _Linux_, _Mac OS_ and _Windows_, run with `curl` or `wget`.
```sh | Method | Command |
curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh | sh |:---------:|:-----------------------------------------------------------------------------------|
``` | **curl** | `curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh | sh` |
| **wget** | `wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - | sh` |
Or with `wget`.
```sh The script will download the [latest binary](https://github.com/ouch-org/ouch/releases) and copy it to `/usr/bin`.
wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - | sh
```
The script will download the latest binary and copy it to `/usr/bin`.
### Installing from source code ### Installing from source code
For compiling, check [the wiki guide](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code). For compiling, check the [wiki guide](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code).
## Supported formats ## Supported formats
| | .tar, .tgz | .zip | .bz, .bz2 | .gz | .xz, .lz, .lzma | .zst | | Format | .tar | .zip | .bz, .bz2 | .gz | .xz, .lz, .lzma | .zst |
|:-------------:|:----:|:----:|:---------:| --- |:---------------:| --- | |:-------------:|:----:|:----:|:---------:| --- |:---------------:| --- |
| Decompression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Supported | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Compression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Note that formats can be chained: And the aliases: `tgz`, `tbz`, `tbz2`, `txz`, `tlz`, `tlzma`, `tzst`.
- `.tar.gz`
- `.tar.xz`
- `.tar.gz.xz`
- `.tar.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz`
- `.gz.xz`
- etc...
Formats can be chained (`ouch` keeps it _fast_):
- `.gz.xz.bz.zst`
- `.tar.gz.xz.bz.zst`
- `.tar.gz.gz.gz.gz.xz.xz.xz.xz.bz.bz.bz.bz.zst.zst.zst.zst`
-
## Contributing ## Contributing
`ouch` is 100% made out of voluntary work, any small contribution is welcome! `ouch` is 100% made out of voluntary work, any small contribution is welcome!
- Open an issue. - Open an issue.
- Open a pr. - Open a pull request.
- Share it to a friend. - Share it to a friend!