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

Re: Passsing descriptions down in completion functions



On 9 Jan, you wrote:
> 
> Sure, I understand that. We already discussed it and I still think that
> instead of modifying every completion function _all_labels should just check
> for existing options and not add them (are there more than just -X? As I

-J and perhaps also -V, -E, -1 and -2. It'd be hard to know which to
check for.

> understand the only options that can be modified by _all_labels are those
> used for explanations. It does not look all that simple after reviewing
> _all_labels but it should be doable).

There are cases where you do want to override any passed descriptions
such as where a function completes something in parts (e.g. in _urls)
but you might want to pass on other options. I'm not too sure about
your suggested change to _all_labels because the result would be less
flexible. If you wanted a solution like that, it might be better to
always add explanations to the end of the options unless some option
was passed to _all_labels. I think the current system is simpler but
will concede that modifying all the functions will be a bore. I'll
volunteer for the job if we agree on doing that though.

> The general question - should completion functions ever accept (be used
> with) other options than compadd? If not the above is perfectly valid and
> probably more simple that modifying every single function. If yes, here is
> the list of functions that use _wanted without '-'.

Quite a few functions accept non compadd options though zparseopts can
easily strip them before they get passed to compadd. Provided they
don't conflict, I don't see a problem with this.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



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