From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2300 invoked from network); 10 Mar 2000 07:03:51 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Mar 2000 07:03:51 -0000 Received: (qmail 2454 invoked by alias); 10 Mar 2000 07:03:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10038 Received: (qmail 2439 invoked from network); 10 Mar 2000 07:03:28 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: "Bart Schaefer" , "ZSH workers mailing list" Subject: RE: GNU diff completion problem Date: Fri, 10 Mar 2000 10:02:58 +0300 Message-ID: <000d01bf8a5e$aadd9330$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 In-Reply-To: <1000309182247.ZM10799@candle.brasslantern.com> > > On Mar 9, 7:45pm, Andrej Borsenkow wrote: > } Subject: GNU diff completion problem > } > } I'm sorry, but I missed this discussion. > } > } Why _diff_options tests diff and not real command ($word[1])? > > It's in case the real command is an alias or function that has unknown > side-effects. > But this applies just as well to any other possible command that has GNU counterpart and needs version check. What is so different with diff? > } I have system default diff and GNU diff as gdiff. Current state does not > } allow me to complete GNU diff at all > > You want > > compdef _diff gdiff > zstyle ':completion:*:*:gdiff:*:version' command gdiff -v > Nope. I do want compdef _diff diff gdiff without bothering, if GNU diff is installed as main or additional program. The above will cover 99.9% of installations. I agree with the point, that _diff_options can be called in context without actual command. But it simply means, that _diff_options should not test diff version itself, but just get a "diff kind" parameter. Actual testing is to be done by _diff. -andrej