summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEitan Adler <lists@eitanadler.com>2020-05-07 19:55:12 -0700
committerEitan Adler <lists@eitanadler.com>2020-05-07 20:03:39 -0700
commitd9ad7e6b89b29cc43c6a0f672af2d6a904910858 (patch)
treedf642c4917d29874d983e3a89f68a769c13a55a9
parent8498f8864e1a8f6991bd99c8068991a706cde436 (diff)
downloadzsh-d9ad7e6b89b29cc43c6a0f672af2d6a904910858.tar.gz
zsh-d9ad7e6b89b29cc43c6a0f672af2d6a904910858.zip
unposted: libarchive tar can extract zip files
Problem Variants of tar based on libarchive can extract zip files but `tar xf <tab>` does not complete this type of file. Solution Add this type of to _tar_archive.
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Type/_tar_archive4
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bddfae9c2..190ca5bfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2020-05-07: Eitan Adler <lists@eitanadler.com>
+ * unposted: Completion/Unix/Type/_tar_archive: libarchive based
+ tar can uncompress zip files
+
2020-05-07 Daniel Shahaf <d.s@daniel.shahaf.name>
* unposted: Completion/Debian/Command/_dscverify,
diff --git a/Completion/Unix/Type/_tar_archive b/Completion/Unix/Type/_tar_archive
index e8ddb1e59..32b25a46f 100644
--- a/Completion/Unix/Type/_tar_archive
+++ b/Completion/Unix/Type/_tar_archive
@@ -20,8 +20,10 @@ 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|libarchive) ]]; then
+ elif [[ "$_cmd_variant[$service]" == gnu ]]; then
_files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz))(-.)'
+ elif [[ "$_cmd_variant[$service]" == libarchive ]]; then
+ _files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz|zip))(-.)'
else
_files "$expl[@]" -g '*.(tar|TAR)(-.)'
fi