Current code will create an archive in the current directory with:
% archive ../test.tar.gz test.*
or will complain that the following archive doesn't exist in the current
directory (given it actually exists in the parent one):
% unarchive ../test.tar.gz
Fix that and allow archives in any directory.
Other changes:
* Use `<required_param>` instead of `[required_param]` in the usage text
* Don't explictly check if archive exists in `unarchive`, but let the
respective tool fail with its own message
Closes#312
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
“unrar-free returns the error code 1 when run without arguments, thus
failing the presence check.” as reported at sorin-ionescu/prezto#1383
Reformat code and use one-liners instead of if/then/fi. And we don’t
need to separate local definitions from assignments anymore starting
from zsh 5.2.