From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19571 invoked from network); 22 Jul 2007 11:35:13 -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 11:35:13 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 98164 invoked from network); 22 Jul 2007 11:35:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jul 2007 11:35:06 -0000 Received: (qmail 24608 invoked by alias); 22 Jul 2007 11:35:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23691 Received: (qmail 24587 invoked from network); 22 Jul 2007 11:35:01 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jul 2007 11:35:01 -0000 Received: (qmail 97472 invoked from network); 22 Jul 2007 11:35:01 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 22 Jul 2007 11:34:58 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id EAABC5C3D0; Sun, 22 Jul 2007 07:34:55 -0400 (EDT) Date: Sun, 22 Jul 2007 07:34:55 -0400 From: Clint Adams To: Renato Botelho Cc: zsh-workers@sunsite.dk Subject: Re: Contributing with Completions Message-ID: <20070722113455.GA4684@scowler.net> Mail-Followup-To: Renato Botelho , zsh-workers@sunsite.dk References: <747dc8f30707180650k7159c9a5lb9c3b743cbab9506@mail.gmail.com> <200707190437.l6J4bcLG031432@news01.csr.com> <747dc8f30707190601v40917b5erdeb07e604d5d5fb4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <747dc8f30707190601v40917b5erdeb07e604d5d5fb4@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-11) 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 -/'