Subject: Re: [PATCHv3] Refactor baud rate completion
From: Oliver Kiddle <[email-masked]>
To: [email-masked]
Date: Wed, 11 May 2016 17:08:55 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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