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

Re: invisible option completions?



Jason McCarty wrote:
> Is it possible with _arguments or some other way to have options that
> can be completed, but aren't displayed on the screen as possible
> completions? I'd like something like
>   _arguments \
>     '(-o)--output[save output in DIR]:DIR:_files -/' \
>     '(--output)-o:DIR:_files -/'
> but where -o doesn't clutter the screen. I know that zsh 4.2 would
> display -o nicely beside --output if I gave it the same explanation, but
> I'd like to support 4.0 as well. Any suggestions?

If you put an exclamation mark before the option description, it won't
be displayed (or completed) but it will still handle the argument:
   '!(--output)-o:DIR:_files -/'

If you want the options to actually be completed too (such as if you
are hiding long option names), then use compadd with the `-n' option.
This won't hide them from menu-selection:
  compadd -n -- -o

Oliver



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