From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5014 invoked by alias); 6 Mar 2011 22:59:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28869 Received: (qmail 1980 invoked from network); 6 Mar 2011 22:59:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at lorien.comfychair.org designates 173.8.144.98 as permitted sender) Date: Sun, 6 Mar 2011 14:59:23 -0800 From: Danek Duvall To: Oliver Kiddle Cc: zsh-workers@zsh.org Subject: Re: completing a comma-separated pair of values Message-ID: <20110306225923.GD18627@lorien.comfychair.org> Mail-Followup-To: Danek Duvall , Oliver Kiddle , zsh-workers@zsh.org References: <20110303230047.GA12871@lorien.comfychair.org> <20110303235836.GB12871@lorien.comfychair.org> <20110305010019.GA18627@lorien.comfychair.org> <87lj0tordv.fsf@gmail.com> <20110305141540.GB18627@lorien.comfychair.org> <9974.1299450496@thecus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9974.1299450496@thecus> User-Agent: Mutt/1.5.20 (2010-04-22) Oliver Kiddle wrote: > I may have misunderstood this but you can use the return status of > compset -P directly so that you possibly don't need this. e.g: > if compset -P '*,'; then Indeed; thanks. I've also added the optional number 1 to -P, which means that it'll prevent you from trying to put a second comma on there and continue completing. > > The only problem is that (I think) this may need to be completed in a > > longer series of comma-separated values: > > You can also do a while loop if there's no particular ordering to things > in the list: while compset -P '*,' Otherwise, use elif for each > component. There's an ordering to the arguments of keysource, but not to the list of things that keysource is in. So we could have foo=64,bar,keysource=passphrase,prompt,baz=true or foo=64,keysource=passphrase,prompt,bar,baz=true etc. I want to complete the two comma-separated values after keysource= with my function, but everything else in this list would be handled naturally by _values, as if keysource took only a single argument. Danek