From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16589 invoked from network); 13 Jul 2002 21:21:20 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Jul 2002 21:21:20 -0000 Received: (qmail 25180 invoked by alias); 13 Jul 2002 21:21:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5161 Received: (qmail 25169 invoked from network); 13 Jul 2002 21:21:08 -0000 From: "Bart Schaefer" Message-Id: <1020713212037.ZM8169@candle.brasslantern.com> Date: Sat, 13 Jul 2002 21:20:37 +0000 In-Reply-To: <20020713193728.GA11214@os> Comments: In reply to GoTaR "Re: completions issues" (Jul 13, 9:37pm) References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@localhost.localdomain> <20020713193728.GA11214@os> X-Mailer: Z-Mail (5.0.0 30July97) To: GoTaR Subject: Re: completions issues Cc: zsh-users@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 13, 9:37pm, GoTaR wrote: } Subject: Re: completions issues } } _sms_aliases () { } smsas=(`smsaddr -l | perl -ne 's/ /:/; if } (/^'$PREFIX'/) {print} else {if (/:'$PREFIX'/) {/^(.*):(.*)$/; print } "$2:$1\n"}}'`) } _describe "SMS alias" "smsas" } } } } And question: how to make it without perl? _sms_aliases () { smsas=( ${(f)$(smsaddr -l)} ) smsas=( ${smsas/ /:} ${smsas/(#s)(#b)(*) (*)(#e)/$match[2]:$match[1]} ) smsas=( ${(M)smsas:#$PREFIX*} ) _describe "SMS alias" smsas } I don't think you even need that last smsas= that matches against $PREFIX, as the completion internals should take care of filtering the possible matches generated by _sms_aliases against the actual input on the line. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net