diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2018-04-05 20:27:39 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2018-04-05 20:27:39 +0900 |
commit | 5dc36c40c322dcbdd9830e523810388c2ffea8a9 (patch) | |
tree | 727de41355eac2c2275217f1fac21fe154d69185 /Completion/Unix | |
parent | bfff8debf78ccca79a6e362c1ee3eb6748578bec (diff) | |
download | zsh-5dc36c40c322dcbdd9830e523810388c2ffea8a9.tar.gz zsh-5dc36c40c322dcbdd9830e523810388c2ffea8a9.tar.xz zsh-5dc36c40c322dcbdd9830e523810388c2ffea8a9.zip |
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).
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/_tar | 2 | ||||
-rw-r--r-- | Completion/Unix/Type/_tar_archive | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index cff50562e..3e44b98f7 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -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 diff --git a/Completion/Unix/Type/_tar_archive b/Completion/Unix/Type/_tar_archive index 28df77638..e8ddb1e59 100644 --- a/Completion/Unix/Type/_tar_archive +++ b/Completion/Unix/Type/_tar_archive @@ -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)(-.)' |