From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25651 invoked from network); 24 Jun 2006 20:14:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jun 2006 20:14:59 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65001 invoked from network); 24 Jun 2006 20:14:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jun 2006 20:14:53 -0000 Received: (qmail 11357 invoked by alias); 24 Jun 2006 20:14:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22513 Received: (qmail 11348 invoked from network); 24 Jun 2006 20:14:49 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jun 2006 20:14:49 -0000 Received: (qmail 64636 invoked from network); 24 Jun 2006 20:14:49 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 24 Jun 2006 20:14:49 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id DB79A70E2F; Sat, 24 Jun 2006 16:14:47 -0400 (EDT) Date: Sat, 24 Jun 2006 16:14:47 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: Re: PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91) Message-ID: <20060624201447.GA25087@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk References: <20060624192616.GA1430@scowler.net> <060624124948.ZM7244@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <060624124948.ZM7244@torch.brasslantern.com> User-Agent: Mutt/1.5.11+cvs20060403 > 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#-}"