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

Re: range in parameter



On Mon, 8 Apr 2002, Dennis Haney wrote:

> _arguments  \
>         {'(-v)--volume','(--volume)-v'}"[Set audio volume to N
> (0-100)]:volume:" \
>
> But how do I specify that all number between 0 and 100 are valid params
> without having to type all 100?

Like this:

_arguments  \
    {'(-v)--volume','(--volume)-v'}"[...]:volume:({0..100})"
                                                 ^^^^^^^^^^

That's not using any special _arguments magic, by the way.  The {0..100}
form is expanded anywhere regular brace expansion applies.



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