zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: bzip2 support for _tar, more tar problems
@ 1999-12-16 22:16 Clint Adams
  1999-12-17  4:39 ` PATCH: some tar problems fixed Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 1999-12-16 22:16 UTC (permalink / raw)
  To: zsh-workers

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


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

end of thread, other threads:[~1999-12-17  4:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-16 22:16 PATCH: bzip2 support for _tar, more tar problems Clint Adams
1999-12-17  4:39 ` PATCH: some tar problems fixed Clint Adams

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