zsh-workers
 help / color / mirror / code / Atom feed
* _tar_archive completion with uncompressed archives && GNU tar
@ 2006-08-04 11:27 Frank Terbeck
  0 siblings, 0 replies; only message in thread
From: Frank Terbeck @ 2006-08-04 11:27 UTC (permalink / raw)
  To: zsh workers

Hello workers!

I experienced a problem with the completion of uncompressed tar
archives:

[snip]
zsh% autoload compinit && compinit
zsh% touch test.tar{,.gz,.bz2}
zsh% tar tvf test.tar.<TAB>
test.tar.bz2  test.tar.gz
[snap]

As you can see it doesn't complete 'test.tar'.
The _tar_archive function checks for $_cmd_variant to figure out if
the system uses the GNU version of tar and selects all compressed
archive files it finds, because GNU tar does some autosensing based on
the filename extension.
Anyway, I think that '.tar' files should be added as well.
This patch adds this behaviour:

--- _tar_archive.orig   2006-08-04 12:49:10.000000000 +0200
+++ _tar_archive        2006-08-04 12:47:48.000000000 +0200
@@ -19,7 +19,7 @@
   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)(-.)'
+    _files "$expl[@]" -g '*.((tar|TAR)(.gz|.GZ|.Z|.bz2|)|tgz)(-.)'
   else
     _files "$expl[@]" -g '*.(tar|TAR)(-.)'
   fi


Regards, Frank


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-04 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-04 11:27 _tar_archive completion with uncompressed archives && GNU tar Frank Terbeck

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).