From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1039 invoked from network); 9 Jul 2005 08:42:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Jul 2005 08:42:30 -0000 Received: (qmail 94460 invoked from network); 9 Jul 2005 08:42:24 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Jul 2005 08:42:24 -0000 Received: (qmail 26403 invoked by alias); 9 Jul 2005 08:42:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9068 Received: (qmail 26392 invoked from network); 9 Jul 2005 08:42:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Jul 2005 08:42:13 -0000 Received: (qmail 93034 invoked from network); 9 Jul 2005 08:42:13 -0000 Received: from wproxy.gmail.com (64.233.184.200) by a.mx.sunsite.dk with SMTP; 9 Jul 2005 08:42:09 -0000 Received: by wproxy.gmail.com with SMTP id 69so615644wri for ; Sat, 09 Jul 2005 01:42:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PHValmsf1CRP2nMIfDgNIIgcS+Aeib95YCt16qtmrQXT3RX10x67W3erIz32TYTBSNvLX8UkXCoZTnXriJ8uOJEKKs3FBj9itEEbx0zxx8XuXTFpE7GUsjKri53SUjagXSvHbn/QGuCSLcbS234ayYX90PDiv1+3zKfhgdaBYwI= Received: by 10.54.80.4 with SMTP id d4mr503788wrb; Sat, 09 Jul 2005 01:42:07 -0700 (PDT) Received: by 10.54.128.12 with HTTP; Sat, 9 Jul 2005 01:42:07 -0700 (PDT) Message-ID: Date: Sat, 9 Jul 2005 01:42:07 -0700 From: Travis Spencer Reply-To: Travis Spencer To: zsh-users@sunsite.dk Subject: Re: Help with completion of option arguments In-Reply-To: <1050709070248.ZM17162@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1050709070248.ZM17162@candle.brasslantern.com> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00,RCVD_BY_IP autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 On 7/9/05, Bart Schaefer wrote: > I mention this to point out that it's almost always better to show the > real example you're working with, rather than attempt to make up an > equivalent one. The exception would be when you're showing a minimal > test case for a bug, but then you should have tried the example to be > sure it demonstrates what you intend it to. OK. I'll do that next time for sure. Sorry about the confusion. The completion, which is my first, is at http://www.travisspencer.com/scripts/_snot.txt. I'm kinda pleased with the way it turned out. Thanks for all the help with it, Bart! > By the way, does your call to _arguments use the ->state mechanism at > any point? If not, you don't need the -C in there. Ya, I am using the state mechanism. > However, the literal answer to your question ... >=20 > } Is there some way to get _arguments to output the messages `test > } sub-message' and `suppress interactive query (for use in crontab)' > } when `-A' or `-B' have been input rather than completing them > } directly? >=20 > ... is, insert an empty string element into the double-parens like this: >=20 > _arguments : \ > "-A-[this is a test]:test:(('' a\:'test sub-message'))" \ > "-B-[notify (e-mail) admins]:notify:(('' > b\:'suppress interactive query (for use in crontab)'))" Wow. Tricky. I would never have figured that out on my own. --=20 Regards, Travis Spencer Portland, OR USA