1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 09:41:44 +02:00

42585: improve completion for libarchive-based tar

Offer all compressed archives if no compression flag is specified
because libarchive can automaticaly recoginize them.
cf. 42574 (Eitan Adler).
This commit is contained in:
Jun-ichi Takimoto 2018-04-05 20:27:39 +09:00
parent bfff8debf7
commit 5dc36c40c3
3 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,11 @@
2018-04-05 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 42585 (cf. 42574: Eitan Adler): Completion/Unix/Command/_tar,
Completion/Unix/Type/_tar_archive: complete all compressed
archives when libarchive-based tar is being used without
compression flag
* 42577: Completion/Unix/Command/_strings: fix macOS support
* 42578: Completion/Unix/Command/_shutdown: add support for macOS

View file

@ -21,7 +21,7 @@ local _tar_cmd tf tmp tmpb del index
# from some of the possible long options, and from the second word if
# that does not start with a hyphen.
if _pick_variant gnu=GNU unix --version; then
if _pick_variant gnu=GNU libarchive=libarchive unix --version; then
case "$($service --version)" in
("tar (GNU tar) "(#b)([0-9.-]##)*)
autoload -z is-at-least

View file

@ -20,7 +20,7 @@ if [[ "$1" = *[urtx]* ]]; then
_files "$expl[@]" -g '*.(tar|TAR).bz2(-.)'
elif [[ "$1" = *J* ]]; then
_files "$expl[@]" -g '*.(tar|TAR).(lzma|xz)(-.)'
elif [[ "$_cmd_variant[$service]" == gnu ]]; then
elif [[ "$_cmd_variant[$service]" == (gnu|libarchive) ]]; then
_files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz))(-.)'
else
_files "$expl[@]" -g '*.(tar|TAR)(-.)'