1
0
Fork 0
mirror of synced 2024-06-26 02:11:09 -04:00
zimfw/modules/archive
Eric Nielsen 1c23ea1604 [archive] Support archive of multiple files
not just one directory.

Also use shorter versions of the `tar` parameters, since we were using a
mixture of the short and long ones among `archive` and `unarchive`.

About not using `$` inside `(( ))`, this is what the the section
ARITHMETIC EVALUATION in zshmisc(1) says:

> Named parameters and subscripted arrays can be referenced by name
> within an arithmetic expression without using the parameter expansion
> syntax.

And according to http://www.bash2zsh.com/zsh_refcard/refcard.pdf:

> `var` (does not require `$` in front unless some substitution e.g.
> `${#var}` is needed, `$` is error if `var` is to be modified)

Closes #308
2018-11-14 20:32:37 -05:00
..
functions [archive] Support archive of multiple files 2018-11-14 20:32:37 -05:00
init.zsh [archive] Check unrar with commands array 2018-02-07 18:27:59 -05:00
README.md [archive] Add missing bzip2 extensions 2018-11-14 20:20:52 -05:00

archive

Provides archive and unarchive functions for easy archive manipulation.

This module will make use of pigz and pbzip2 if available to make use of all available CPU cores.

Functions

  • archive generates an archive based on file extension. Syntax is archive myarchive.tar.gz /path/to/archive
  • unarchive unarchives a file based on the extension. Syntax is unarchive myarchive.7z

Archive formats

Format Requirements
.tar tar
.tar.gz, .tgz tar or pigz
.tar.bz, .tar.bz2, .tbz, .tbz2 tar or pbzip2
.tar.xz, .txz tar with xz support
.tar.zma, .tlz tar with lzma support
.gz gunzip or pigz
.bz, .bz2 bunzip2 or pbzip2
.xz unxz
.lzma unzlma
.Z uncompress
.zip unzip
.rar unrar or rar
.7z 7za