Skip to content

Commit

Permalink
update project
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Mar 19, 2022
1 parent 12d4f23 commit f1b373a
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
toolchain: nightly
override: true
components: clippy
- run: cargo clippy -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings

tests-1:
strategy:
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "xcompress"
version = "0.11.6"
version = "0.11.7"
authors = ["Magic Len <[email protected]>"]
edition = "2018"
edition = "2021"
repository = "https://github.com/magiclen/xcompress"
homepage = "https://magiclen.org/xcompress"
keywords = ["compression", "decompression", "zip", "archive", "tar"]
Expand All @@ -18,7 +18,7 @@ codegen-units = 1
panic = "abort"

[dependencies]
clap = "2.33.1"
clap = "3.1.6"
concat-with = "0.2"
terminal_size = "0.1"

Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
all: ./target/x86_64-unknown-linux-musl/release/xcompress
EXECUTABLE_NAME := xcompress

./target/x86_64-unknown-linux-musl/release/xcompress: $(shell find . -type f -iname '*.rs' -o -name 'Cargo.toml' | sed 's/ /\\ /g')
all: ./target/x86_64-unknown-linux-musl/release/$(EXECUTABLE_NAME)

./target/x86_64-unknown-linux-musl/release/$(EXECUTABLE_NAME): $(shell find . -type f -iname '*.rs' -o -name 'Cargo.toml' | sed 's/ /\\ /g')
cargo build --release --target x86_64-unknown-linux-musl
strip ./target/x86_64-unknown-linux-musl/release/xcompress
strip ./target/x86_64-unknown-linux-musl/release/$(EXECUTABLE_NAME)

install:
$(MAKE)
sudo cp ./target/x86_64-unknown-linux-musl/release/xcompress /usr/local/bin/xcompress
sudo chown root: /usr/local/bin/xcompress
sudo chmod 0755 /usr/local/bin/xcompress
sudo cp ./target/x86_64-unknown-linux-musl/release/$(EXECUTABLE_NAME) /usr/local/bin/$(EXECUTABLE_NAME)
sudo chown root: /usr/local/bin/$(EXECUTABLE_NAME)
sudo chmod 0755 /usr/local/bin/$(EXECUTABLE_NAME)

uninstall:
sudo rm /usr/local/bin/xcompress
sudo rm /usr/local/bin/$(EXECUTABLE_NAME)

test:
cargo test --verbose
Expand Down
89 changes: 42 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,54 @@ XCompress is a free file archiver utility on Linux, providing multi-format archi

```
EXAMPLES:
xcompress a foo.wav # Archives foo.wav to foo.rar
xcompress a foo.wav /root/bar.txt # Archives foo.wav and /root/bar.txt to foo.rar
xcompress a -o /tmp/out.7z foo.wav # Archives foo.wav to /tmp/out.7z
xcompress a -b foo/bar # Archives foo/bar folder to bar.rar as small as possible
xcompress a -p password foo.wav # Archives foo.wav to foo.rar with a password
xcompress x foo.rar # Extracts foo.rar into current working directory
xcompress x foo.tar.gz /tmp/out_folder # Extracts foo.tar.gz into /tmp/out_folder
xcompress x -p password foo.rar # Extracts foo.rar with a password into current working directory
xcompress a foo.wav # Archive foo.wav to foo.rar
xcompress a foo.wav /root/bar.txt # Archive foo.wav and /root/bar.txt to foo.rar
xcompress a -o /tmp/out.7z foo.wav # Archive foo.wav to /tmp/out.7z
xcompress a -b foo/bar # Archive foo/bar folder to bar.rar as small as possible
xcompress a -p password foo.wav # Archive foo.wav to foo.rar with a password
xcompress x foo.rar # Extract foo.rar into current working directory
xcompress x foo.tar.gz /tmp/out_folder # Extract foo.tar.gz into /tmp/out_folder
xcompress x -p password foo.rar # Extract foo.rar with a password into current working directory
USAGE:
xcompress [FLAGS] [OPTIONS] [SUBCOMMAND]
FLAGS:
-q, --quiet Makes programs not print anything on the screen.
-s, --single-thread Uses only one thread.
-h, --help Prints help information
-V, --version Prints version information
xcompress [OPTIONS] [SUBCOMMAND]
OPTIONS:
-p, --password <PASSWORD> Sets password for your archive file. (Only supports 7Z, ZIP and RAR.) Set an
empty string to read a password from stdin.
--7z-path <7Z_PATH> Specifies the path of your 7z executable binary file. [default: 7z]
--bunzip2-path <BUNZIP2_PATH> Specifies the path of your bunzip2 executable binary file. [default: bunzip2]
--bzip2-path <BZIP2_PATH> Specifies the path of your bzip2 executable binary file. [default: bzip2]
--compress-path <COMPRESS_PATH> Specifies the path of your compress executable binary file. [default:
compress]
--gunzip-path <GUNZIP_PATH> Specifies the path of your gunzip executable binary file. [default: gunzip]
--gzip-path <GZIP_PATH> Specifies the path of your gzip executable binary file. [default: gzip]
--lbzip2-path <LBZIP2_PATH> Specifies the path of your lbzip2 executable binary file. [default: lbzip2]
--lunzip-path <LUNZIP_PATH> Specifies the path of your lunzip executable binary file. [default: lunzip]
--lzip-path <LZIP_PATH> Specifies the path of your lzip executable binary file. [default: lzip]
--lzma-path <LZMA_PATH> Specifies the path of your lzma executable binary file. [default: lzma]
--pbzip2-path <PBZIP2_PATH> Specifies the path of your pbzip2 executable binary file. [default: pbzip2]
--pigz-path <PIGZ_PATH> Specifies the path of your pigz executable binary file. [default: pigz]
--plzip-path <PLZIP_PATH> Specifies the path of your plzip executable binary file. [default: plzip]
--pxz-path <PXZ_PATH> Specifies the path of your pxz executable binary file. [default: pxz]
--pzstd-path <PZSTD_PATH> Specifies the path of your pzstd executable binary file. [default: pzstd]
--rar-path <RAR_PATH> Specifies the path of your rar executable binary file. [default: rar]
--tar-path <TAR_PATH> Specifies the path of your tar executable binary file. [default: tar]
--unlzma-path <UNLZMA_PATH> Specifies the path of your unlzma executable binary file. [default: unlzma]
--unrar-path <UNRAR_PATH> Specifies the path of your unrar executable binary file. [default: unrar]
--unxz-path <UNXZ_PATH> Specifies the path of your unxz executable binary file. [default: unxz]
--unzip-path <UNZIP_PATH> Specifies the path of your unzip executable binary file. [default: unzip]
--unzstd-path <UNZSTD_PATH> Specifies the path of your unzstd executable binary file. [default: unzstd]
--xz-path <XZ_PATH> Specifies the path of your xz executable binary file. [default: xz]
--zip-path <ZIP_PATH> Specifies the path of your zip executable binary file. [default: zip]
--zstd-path <ZSTD_PATH> Specifies the path of your zstd executable binary file. [default: zstd]
-p, --password <PASSWORD> Set password for your archive file. (Only supports 7Z, ZIP and RAR.) Set an empty string to read a password from stdin.
--7z-path <7Z_PATH> Specify the path of your 7z executable binary file. [default: 7z]
--bunzip2-path <BUNZIP2_PATH> Specify the path of your bunzip2 executable binary file. [default: bunzip2]
--bzip2-path <BZIP2_PATH> Specify the path of your bzip2 executable binary file. [default: bzip2]
--compress-path <COMPRESS_PATH> Specify the path of your compress executable binary file. [default: compress]
--gunzip-path <GUNZIP_PATH> Specify the path of your gunzip executable binary file. [default: gunzip]
--gzip-path <GZIP_PATH> Specify the path of your gzip executable binary file. [default: gzip]
-h, --help Print help information
--lbzip2-path <LBZIP2_PATH> Specify the path of your lbzip2 executable binary file. [default: lbzip2]
--lunzip-path <LUNZIP_PATH> Specify the path of your lunzip executable binary file. [default: lunzip]
--lzip-path <LZIP_PATH> Specify the path of your lzip executable binary file. [default: lzip]
--lzma-path <LZMA_PATH> Specify the path of your lzma executable binary file. [default: lzma]
--pbzip2-path <PBZIP2_PATH> Specify the path of your pbzip2 executable binary file. [default: pbzip2]
--pigz-path <PIGZ_PATH> Specify the path of your pigz executable binary file. [default: pigz]
--plzip-path <PLZIP_PATH> Specify the path of your plzip executable binary file. [default: plzip]
--pxz-path <PXZ_PATH> Specify the path of your pxz executable binary file. [default: pxz]
--pzstd-path <PZSTD_PATH> Specify the path of your pzstd executable binary file. [default: pzstd]
-q, --quiet Make programs not print anything on the screen.
--rar-path <RAR_PATH> Specify the path of your rar executable binary file. [default: rar]
-s, --single-thread Use only one thread.
--tar-path <TAR_PATH> Specify the path of your tar executable binary file. [default: tar]
--unlzma-path <UNLZMA_PATH> Specify the path of your unlzma executable binary file. [default: unlzma]
--unrar-path <UNRAR_PATH> Specify the path of your unrar executable binary file. [default: unrar]
--unxz-path <UNXZ_PATH> Specify the path of your unxz executable binary file. [default: unxz]
--unzip-path <UNZIP_PATH> Specify the path of your unzip executable binary file. [default: unzip]
--unzstd-path <UNZSTD_PATH> Specify the path of your unzstd executable binary file. [default: unzstd]
-V, --version Print version information
--xz-path <XZ_PATH> Specify the path of your xz executable binary file. [default: xz]
--zip-path <ZIP_PATH> Specify the path of your zip executable binary file. [default: zip]
--zstd-path <ZSTD_PATH> Specify the path of your zstd executable binary file. [default: zstd]
SUBCOMMANDS:
a Adds files to archive. Excludes base directory from names. (e.g. add /path/to/folder, you can always get
the "folder" in the root of the archive file, instead of /path/to/folder.)
help Prints this message or the help of the given subcommand(s)
x Extracts files with full path.
a Add files to archive. Excludes base directory from names. (e.g. add /path/to/folder, you can always get the "folder" in the root of the archive file, instead of /path/to/folder.)
help Print this message or the help of the given subcommand(s)
x Extract files with full path.
```

## License
Expand Down
Loading

0 comments on commit f1b373a

Please sign in to comment.