From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5018 invoked from network); 14 Jul 2002 21:10:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Jul 2002 21:10:04 -0000 Received: (qmail 23792 invoked by alias); 14 Jul 2002 21:09:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5165 Received: (qmail 23776 invoked from network); 14 Jul 2002 21:09:47 -0000 From: "Bart Schaefer" Message-Id: <1020714210916.ZM15050@candle.brasslantern.com> Date: Sun, 14 Jul 2002 21:09:16 +0000 In-Reply-To: <20020714105554.GC824@os> Comments: In reply to GoTaR "Re: completions issues" (Jul 14, 12:55pm) References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@localhost.localdomain> <20020713193728.GA11214@os> <1020713212037.ZM8169@candle.brasslantern.com> <20020714105554.GC824@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 14, 12:55pm, GoTaR wrote: } Subject: Re: completions issues } } On Sat, Jul 13, 2002 at 21:20:37 +0000, Bart Schaefer wrote: } } > } And question: how to make it without perl? } > } > smsas=( ${(f)$(smsaddr -l)} ) } } Here is the first trap - ${(f)... will change double tab to space That has nothing to do with ${(f)...}. It's just that I lost the double quotes somehow when typing my reply: smsas=( ${(f)"$(smsaddr -l)"} ) Elsewhere, you wrote: } No no no, adding both will cause showing them _all_ when completion } without any prefix - and I don't want doubled entries like this: } } gotar:~: smsaddr -l [tab] } SMS alias } rtrzepla -- 692xxx } 692xxx -- rtrzepla Getting a little demanding, aren't we? Anyway, just add the inverted pairs only when the word on the line is non-empty, and then let completion deal with it from there. _sms_aliases () { smsas=( ${(f)"$(smsaddr -l)"} ) smsas=( ${smsas/ /:} ) if [[ -n "$PREFIX$SUFFIX" ]]; then smsas=( ${smsas/(#s)(#b)(*) (*)(#e)/$match[2]:$match[1]} ) fi _describe "SMS alias" smsas } -- 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