Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Match on range
- X-seq: zsh-users 2459
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Match on range
- Date: Fri, 23 Jul 1999 08:53:43 +0200 (MET DST)
- In-reply-to: Bek Oberin's message of Thu, 22 Jul 1999 10:35:57 +1000
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Bek Oberin wrote:
> For the completion of playcd, I want to match any number of a range
> created like this:
> 1-`cd-discid /dev/cdrom | cut -f2 -d' '`
> but I can't get compctl to recognize it as a range. Can it even
> -do- ranges?
No, it can't.
> Closest I've got is this:
> compctl -k "(1-`cd-discid /dev/cdrom | cut -f2 -d' '`)" playcd
> but that just matches on an array with one member, being "1-18" or
> whatever. Not a range.
>
> Any ideas?
If you don't have braceccl set, the cleanest solution would probably
use a function:
compctl -K comp_tracks playcd
comp_tracks() {
setopt localoptions braceccl
reply=( {1-$(cd-discid /dev/cdrom | cut -f2 -d' ')} )
}
If you have braceccl set, something like this should do the job:
compctl -s '{1-$(cd-discid /dev/cdrom | cut -f2 -d' ')}' playcd
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author