From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20559 invoked from network); 22 Nov 2006 10:40:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Nov 2006 10:40:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 95118 invoked from network); 22 Nov 2006 10:40:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 10:40:13 -0000 Received: (qmail 25767 invoked by alias); 22 Nov 2006 10:40:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11015 Received: (qmail 25742 invoked from network); 22 Nov 2006 10:40:01 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Nov 2006 10:40:01 -0000 Received: (qmail 93459 invoked from network); 22 Nov 2006 10:40:01 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 10:39:58 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly03d.srv.mailcontrol.com (MailControl) with ESMTP id kAMAdp2H006104 for ; Wed, 22 Nov 2006 10:39:52 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Wed, 22 Nov 2006 10:39:51 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.7/8.13.4) with ESMTP id kAMAdpZ1021909 for ; Wed, 22 Nov 2006 10:39:51 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.7/8.13.7/Submit) with ESMTP id kAMAdpal021905 for ; Wed, 22 Nov 2006 10:39:51 GMT Message-Id: <200611221039.kAMAdpal021905@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "zsh-users@sunsite.dk" Subject: Re: Problem with _arguments In-reply-to: References: <200611212342.kALNg9m7006648@pwslaptop.csr.com> Comments: In-reply-to "Nikolai Weibull" message dated "Wed, 22 Nov 2006 09:35:37 +0100." Date: Wed, 22 Nov 2006 10:39:51 +0000 From: Peter Stephenson X-OriginalArrivalTime: 22 Nov 2006 10:39:51.0908 (UTC) FILETIME=[8A864240:01C70E22] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-06-75 (www.mailcontrol.com) on 10.68.0.113 "Nikolai Weibull" wrote: > > > _arguments \ > > > '-s[omething]:with an argument' \ > > > '*:directory:_directories' > > > > > > % craptastic src -s > > > ::: with an argument ::: > > > ::: directory ::: > > But it still offers the completion for -s, so it must have /some/ sort > of understanding of what's going on already. Right, my answer was a bit dozy... it looks like it's hedging, i.e. it's completing as if the strict POSIX and GNU forms are both allowed and it can't tell which applies. > Actually, would there be a good way of tricking _arguments into only > seeing what you want it to see? In this case, it would work fine if > one could trick it into only seeing the stuff after src, so that it > would continue completing options. There are certainly ways of updating the line, but the trouble is to find out what you need to do either you're going to be doing some parsing yourself or running _arguments twice. You can edit words (the command line) and CURRENT (the index into it), plus it's also possible in some contexts to tell _arguments to limit the words visible in the completion that it's calling by the use of enough colons. I find directly manipulating words and CURRENT less infuriating. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php