From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14907 invoked from network); 22 Jul 2007 15:35:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Jul 2007 15:35:14 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 56186 invoked from network); 22 Jul 2007 15:35:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jul 2007 15:35:06 -0000 Received: (qmail 1411 invoked by alias); 22 Jul 2007 15:35:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23692 Received: (qmail 1375 invoked from network); 22 Jul 2007 15:35:00 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jul 2007 15:35:00 -0000 Received: (qmail 55445 invoked from network); 22 Jul 2007 15:35:00 -0000 Received: from ug-out-1314.google.com (66.249.92.168) by a.mx.sunsite.dk with SMTP; 22 Jul 2007 15:34:57 -0000 Received: by ug-out-1314.google.com with SMTP id u2so818717uge for ; Sun, 22 Jul 2007 08:34:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iqBZw2NV7JRGiXNvAlP6eWi30iJMHjTQ8+m21YbqnIyNfCXigGX8ZVsKO9ts29Y/YipSjUMH8RF2lGwAT5dJ4Nc2WOWqGXdsz0PaHKBkcEIFo7chZPWBNqOHmP1UT0YRQbz3PwvhSvD1Qj8oV/IfZr2m3HuxDXWPFP3q09TWEhQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=trvL0HBD558/h4prkmCMhQvDzys9/1FGRnpIiA6FOPInO5YjuvcvJwZm+o9DYf6Su1AswrvJMPUJ9OEkPHxndCRVS7Rg50AdBPZKCuL4/ijF5khWxBLN3FeYp6Tou18IiJV1lBFyVWWpjS3BKNTAqkAptiMv9PXTQqJ3bMxaYt8= Received: by 10.78.145.5 with SMTP id s5mr541143hud.1185118495544; Sun, 22 Jul 2007 08:34:55 -0700 (PDT) Received: by 10.78.163.10 with HTTP; Sun, 22 Jul 2007 08:34:55 -0700 (PDT) Message-ID: <747dc8f30707220834g7bf2f65fja92f0a3c6bcb3d7d@mail.gmail.com> Date: Sun, 22 Jul 2007 12:34:55 -0300 From: "Renato Botelho" To: zsh-workers@sunsite.dk Subject: Re: Contributing with Completions In-Reply-To: <20070722113455.GA4684@scowler.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <747dc8f30707180650k7159c9a5lb9c3b743cbab9506@mail.gmail.com> <200707190437.l6J4bcLG031432@news01.csr.com> <747dc8f30707190601v40917b5erdeb07e604d5d5fb4@mail.gmail.com> <20070722113455.GA4684@scowler.net> On 7/22/07, Clint Adams wrote: > On Thu, Jul 19, 2007 at 10:01:34AM -0300, Renato Botelho wrote: > > _portsnap -> Tool for get/update FreeBSD ports tree using snapshots > > > > Comments, suggestions, critics are welcome, like I said, these are my > > first lines in zsh since i'm using it for less than a week. > > When you use ->state, you should declare the scope of the parameters > context, state, line, opt_args. > > Index: Completion/BSD/Command/_portsnap > =================================================================== > RCS file: /cvsroot/zsh/zsh/Completion/BSD/Command/_portsnap,v > retrieving revision 1.1 > diff -u -r1.1 _portsnap > --- Completion/BSD/Command/_portsnap 20 Jul 2007 16:39:15 -0000 1.1 > +++ Completion/BSD/Command/_portsnap 22 Jul 2007 11:12:05 -0000 > @@ -1,5 +1,8 @@ > #compdef portsnap > > +local context state line > +typeset -A opt_args > + > flags=( > '(cron)fetch[Fetch a compressed snapshot or update existing one]' > '(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]' > @@ -17,7 +20,7 @@ > '-s:Server from which to fetch updates:_hosts' \ > '*:principal:->principal' && ret=0 > > -if [[ $state = principal ]]; then > +if [[ $state == principal ]]; then > _alternative \ > ':file flag:_values -S " " -w "commands" $flags[@]' \ > '*:path:_files -/' Thanks -- Renato Botelho