* Match on range
@ 1999-07-22 0:35 Bek Oberin
0 siblings, 0 replies; 3+ messages in thread
From: Bek Oberin @ 1999-07-22 0:35 UTC (permalink / raw)
To: Zsh Users
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?
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?
bekj
--
: --Hacker-Neophile-Eclectic-Geek-Grrl-Queer-Disabled-Boychick--
: gossamer@tertius.net.au http://www.tertius.net.au/~gossamer/
: Laughter is the closest distance between two people.
: -- Victor Borge
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Match on range
@ 1999-07-23 8:21 Sven Wischnowsky
0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-07-23 8:21 UTC (permalink / raw)
To: zsh-users
I wrote:
> If you have braceccl set, something like this should do the job:
>
> compctl -s '{1-$(cd-discid /dev/cdrom | cut -f2 -d' ')}' playcd
Ugh, errr... too much cut'n'paste:
compctl -s '{1-$(cd-discid /dev/cdrom | cut -f2 -d" ")}' playcd
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Match on range
@ 1999-07-23 6:53 Sven Wischnowsky
0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-07-23 6:53 UTC (permalink / raw)
To: zsh-users
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-07-23 8:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-22 0:35 Match on range Bek Oberin
1999-07-23 6:53 Sven Wischnowsky
1999-07-23 8:21 Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).