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

Re: [PATCHv3] Refactor baud rate completion



On 7 May, Frank Terbeck wrote:
> I don't know if there is a simple way to make it work the way I'd like
> (unsorted group as well as inheriting the right description), so I ended
> up doing this:
>
>     _description -1V baud-rates expl 'baud rate'
>     compadd "${(@)argv/#-J/-V}" "$expl[@]" -- "${rates[@]}"
>
> That feels pretty dirty, but it seems to work.

That looks like the best approach to me. It's the compadd interface
that's dirty and we're too late to fix that.

> The completion-style-guide mentions the following:
>
>     _description -1V tag expl '...'
>     compadd "$expl[@]" - ...
>
> But that would discard any descriptions given in an _arguments call.

The style guide could be improved to recommend passing on the
arguments.

Oliver



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