Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91)
- X-seq: zsh-workers 22511
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91)
- Date: Sat, 24 Jun 2006 15:26:16 -0400
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Since version 1.14.91, GNU tar has autodetected compressed
archives.
Index: Completion/Unix/Command/_tar
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_tar,v
retrieving revision 1.3
diff -u -r1.3 _tar
--- Completion/Unix/Command/_tar 27 Feb 2003 09:29:26 -0000 1.3
+++ Completion/Unix/Command/_tar 24 Jun 2006 19:24:54 -0000
@@ -21,6 +21,8 @@
# from some of the possible long options, and from the second word if
# that does not start with a hyphen.
+_pick_variant gnu=GNU unix --version
+
tmp=("${(@M)words:#-[^-]*}")
_tar_cmd="${(j::)tmp#-}"
Index: Completion/Unix/Type/_tar_archive
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_tar_archive,v
retrieving revision 1.3
diff -u -r1.3 _tar_archive
--- Completion/Unix/Type/_tar_archive 21 Jan 2004 13:53:29 -0000 1.3
+++ Completion/Unix/Type/_tar_archive 24 Jun 2006 19:24:54 -0000
@@ -18,6 +18,8 @@
_files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)'
elif [[ "$1" = *[Ijy]* ]]; then
_files "$expl[@]" -g '*.(tar|TAR).bz2(-.)'
+ elif [[ "$_cmd_variant[$service]" == gnu ]]; then
+ _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z|bz2)|tgz)(-.)'
else
_files "$expl[@]" -g '*.(tar|TAR)(-.)'
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author