From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91)
Date: Sat, 24 Jun 2006 16:14:47 -0400 [thread overview]
Message-ID: <20060624201447.GA25087@scowler.net> (raw)
In-Reply-To: <060624124948.ZM7244@torch.brasslantern.com>
> I'm not entirely certain this patch is a good idea. It doesn't
> really hurt to have a completer offer things like command-line
> options for the latest version of a program, but to complete a
> file that an older version won't know what to do with is a bit
> worse.
How about this?
Index: Completion/Unix/Command/_tar
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_tar,v
retrieving revision 1.4
diff -u -r1.4 _tar
--- Completion/Unix/Command/_tar 24 Jun 2006 19:28:55 -0000 1.4
+++ Completion/Unix/Command/_tar 24 Jun 2006 20:13:34 -0000
@@ -21,7 +21,13 @@
# 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
+if _pick_variant gnu=GNU unix --version; then
+ case "$($service --version)" in
+ (tar \(GNU tar\) (#b)([0-9.-]##)*)
+ is_at_least 1.14.91 "$match[1]" || _cmd_variant[$service]="gnu-old"
+ ;;
+ esac
+fi
tmp=("${(@M)words:#-[^-]*}")
_tar_cmd="${(j::)tmp#-}"
next prev parent reply other threads:[~2006-06-24 20:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-24 19:26 Clint Adams
2006-06-24 19:49 ` Bart Schaefer
2006-06-24 20:14 ` Clint Adams [this message]
2006-06-25 4:24 ` Bart Schaefer
2006-06-26 14:28 ` Oliver Kiddle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060624201447.GA25087@scowler.net \
--to=clint@zsh.org \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).