Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: bzip2 support for _tar, more tar problems



tar xvzCf /tmp archiv<TAB> will not complete to archive.tar.gz;
instead it attempts to untar /tmp in search of archive within.
There should probably be a sanity check first to avoid untarring
directories, and then _tar should recognize the -C and pass
-W /tmp to _files in _tar_archive.

tar --directory=/tmp xvzf archiv<TAB>, on the other hand,
will work, but it is merely doing a _path_files -W /tmp,
thus losing all the smarts it would have without the
--directory.  This should also be calling _tar_archive
which in turn should do a -W /tmp.

Unfortunately, _tar_archive is counting on $1 containing
the flags; I think _tar_archive should take these as
arguments.

Index: Completion/User/_tar_archive
===================================================================
RCS file: /cvs/zsh/zsh/Completion/User/_tar_archive,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 _tar_archive
--- Completion/User/_tar_archive	1999/12/01 15:29:44	1.1.1.3
+++ Completion/User/_tar_archive	1999/12/16 22:12:50
@@ -16,6 +16,8 @@
 if [[ "$1" = *[tx]* ]]; then
   if [[ "$1" = *[zZ]* ]]; then
     _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|.tgz)'
+  elif [[ "$1" = *I* ]]; then
+    _files "$expl[@]" -g '*.(tar|TAR).bz2'
   else
     _files "$expl[@]" -g '*.(tar|TAR)'
   fi



Messages sorted by: Reverse Date, Date, Thread, Author