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

Re: Complete value from list with colons



On 26 Aug 2019, at 08:34, Scott Frazer <frazer.scott@xxxxxxxxx> wrote:
> _arguments : '--foo[Which foo to use]:foo:_values whatever 'a\:\:b' 'c\:\:d'
>
> i.e. the --foo option has a limited number of legal values.  What would you
> suggest I use here?

If you're using _arguments you can just do like:

  '--foo[specify foo to use]:foo:(a\:\:b c\:\:d)'

You can also use this syntax to give each value a description:

  '--foo[specify foo to use]:foo:((
    a\\\:\\\:b\:"ab foo"
    c\\\:\\\:d\:"cd foo"
  ))'

Though it gets somewhat confusing when you have colons in the values, as you
can see

dana



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