zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91)
@ 2006-06-24 19:26 Clint Adams
  2006-06-24 19:49 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Clint Adams @ 2006-06-24 19:26 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-26 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-24 19:26 PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91) Clint Adams
2006-06-24 19:49 ` Bart Schaefer
2006-06-24 20:14   ` Clint Adams
2006-06-25  4:24     ` Bart Schaefer
2006-06-26 14:28     ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).