Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completions issues
- X-seq: zsh-users 5161
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: GoTaR <gotar@xxxxxxxxxxxxxx>
- Subject: Re: completions issues
- Date: Sat, 13 Jul 2002 21:20:37 +0000
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20020713193728.GA11214@os>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020710204701.GA3362@os> <1026499603.2775.6.camel@xxxxxxxxxxxxxxxxxxxxx> <20020713193728.GA11214@os>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author