From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20790 invoked from network); 14 Jul 2002 08:57:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Jul 2002 08:57:39 -0000 Received: (qmail 18324 invoked by alias); 14 Jul 2002 08:57:19 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5162 Received: (qmail 18312 invoked from network); 14 Jul 2002 08:57:18 -0000 From: Borsenkow Andrej To: GoTaR Cc: zsh-users@sunsite.dk Subject: Re: completions issues In-Reply-To: <20020713193728.GA11214@os> References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@localhost.localdomain> <20020713193728.GA11214@os> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Mailer: Ximian Evolution 1.0.8-1mdk Date: 14 Jul 2002 12:57:10 +0400 Message-Id: <1026637038.2785.3.camel@localhost.localdomain> Mime-Version: 1.0 =F7 =F3=C2=D4, 13.07.2002, =D7 23:37, GoTaR =CE=C1=D0=C9=D3=C1=CC: > On Fri, Jul 12, 2002 at 22:44:56 +0400, Borsenkow Andrej wrote: >=20 > > with obvious error checking. If you want to add numbers as = descriptions, > > somebody else better explains how to do it :-)=20 >=20 > Ok, I've done this this way, perl rox;) >=20 > _sms_aliases () { > smsas=3D(`smsaddr -l | perl -ne 's/ /:/; if > (/^'$PREFIX'/) {print} else {if (/:'$PREFIX'/) {/^(.*):(.*)$/; print > "$2:$1\n"}}'`) > _describe "SMS alias" "smsas" > } >=20 [...] > gotar:~: smsaddr -l r[tab] > SMS alias > rtrzepla -- 692xxx > rzuku -- 609xxx >=20 > gotar:~: smsaddr -l 6[tab] > SMS alias > 600xxx -- prudy > 602xxx -- admol Oh, if you want _this_ you do not need any perl magic at all. Just add all your SMS aliases two times - once as alias:number and second time = as number:alias. Completion does all matching for you. I assumed you always to always have alias name as match and number as description. Here you should do matching yourself. But not in above = case when completion does it for you. -andrej