summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2009-12-03 05:33:14 +0000
committerClint Adams <clint@users.sourceforge.net>2009-12-03 05:33:14 +0000
commitf35932958fccbd464d8e8514a106fef6d9c86ff3 (patch)
treef11ed6439edd1c5c48039fef70eb71115692bde9
parentdc717207097bf4840e4145af999418658b5ca053 (diff)
downloadzsh-f35932958fccbd464d8e8514a106fef6d9c86ff3.tar.gz
zsh-f35932958fccbd464d8e8514a106fef6d9c86ff3.zip
27448: mild understanding of xz-compressed tarballs.
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Unix/Command/_tar4
-rw-r--r--Completion/Unix/Type/_tar_archive4
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c9b6303b0..859f7094f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-03 Clint Adams <clint@zsh.org>
+
+ * 27448: Completion/Unix/Command/_tar,
+ Completion/Unix/Type/_tar_archive: mild understanding of
+ xz-compressed tarballs.
+
2009-12-02 Peter Stephenson <pws@csr.com>
* 27447: Doc/Zsh/options.yo: document 27442.
@@ -12424,5 +12430,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4829 $
+* $Revision: 1.4830 $
*****************************************************
diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar
index 334605137..4f3247291 100644
--- a/Completion/Unix/Command/_tar
+++ b/Completion/Unix/Command/_tar
@@ -35,6 +35,8 @@ _tar_cmd="${(j::)tmp#-}"
(( $words[(I)--(un|)gzip] )) && _tar_cmd="z$_tar_cmd"
(( $words[(I)--(un|)compress] )) && _tar_cmd="Z$_tar_cmd"
+(( $words[(I)--bzip2] )) && _tar_cmd="j$_tar_cmd"
+(( $words[(I)--xz] )) && _tar_cmd="J$_tar_cmd"
(( $words[(I)--list] )) && _tar_cmd="t$_tar_cmd"
(( $words[(I)--(extract|get)] )) && _tar_cmd="x$_tar_cmd"
(( $words[(I)--create] )) && _tar_cmd="c$_tar_cmd"
@@ -141,6 +143,8 @@ elif [[ ( "$_tar_cmd" = *[xt]* || -n $del ) && -n "$tf" ]]; then
largs=-tZf
elif [[ $_tar_cmd = *I* ]]; then
largs=-tIf
+ elif [[ $_tar_cmd = *J* ]]; then
+ largs=-tJf
else
# Some random compression program
tmp="${words[(r)--use-comp*]}"
diff --git a/Completion/Unix/Type/_tar_archive b/Completion/Unix/Type/_tar_archive
index 1ac7cd0bf..a39e841f8 100644
--- a/Completion/Unix/Type/_tar_archive
+++ b/Completion/Unix/Type/_tar_archive
@@ -18,8 +18,10 @@ if [[ "$1" = *[urtx]* ]]; then
_files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)'
elif [[ "$1" = *[Ijy]* ]]; then
_files "$expl[@]" -g '*.(tar|TAR).bz2(-.)'
+ elif [[ "$1" = *J* ]]; then
+ _files "$expl[@]" -g '*.(tar|TAR).xz(-.)'
elif [[ "$_cmd_variant[$service]" == gnu ]]; then
- _files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|)|tgz)(-.)'
+ _files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|xz|)|tgz)(-.)'
else
_files "$expl[@]" -g '*.(tar|TAR)(-.)'
fi