Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completions issues



В Сбт, 13.07.2002, в 23:37, GoTaR написал:
> On Fri, Jul 12, 2002 at 22:44:56 +0400, Borsenkow Andrej wrote:
> 
> > with obvious error checking. If you want to add numbers as descriptions,
> > somebody else better explains how to do it :-) 
> 
> Ok, I've done this this way, perl rox;)
> 
> _sms_aliases () {
>         smsas=(`smsaddr -l | perl -ne 's/		/:/; if
> (/^'$PREFIX'/) {print} else {if (/:'$PREFIX'/) {/^(.*):(.*)$/; print
> "$2:$1\n"}}'`)
>         _describe "SMS alias" "smsas"
> }
> 
[...]
> gotar:~: smsaddr -l r[tab]
> SMS alias
> rtrzepla -- 692xxx
> rzuku    -- 609xxx
> 
> 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



Messages sorted by: Reverse Date, Date, Thread, Author