Zsh Mailing List Archive
Messages sorted by:
RE: Passsing descriptions down in completion functions
- X-seq: zsh-workers 18065
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: RE: Passsing descriptions down in completion functions
- Date: Thu, 9 Jan 2003 18:09:50 +0300
- Importance: Normal
- In-reply-to: <32149.1042120127@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
> compadd takes the first description on the line so a function like
> _hosts needs to add any explanations after those that have been passed
> as arguments.
> _hosts does roughly:
> _wanted hosts expl host compadd "$@" -a hosts
> which is turned into the compadd line you quoted above. The explanation
> arguments added by _wanted are inserted before a `-' argument so if you
> rewrite the last line of _hosts as:
> _wanted hosts expl host compadd "$@" - $hosts
> It will work.
> The first bug (in my opinion) is that
> _wanted hosts expl host compadd "$@" -a hosts -
> does not work because any explanation arguments after the -a option are
> The second bug is that there are loads of functions like _hosts which
> don't use this `-' argument trick, mainly because the _wanted feature
> was added later and nobody ever went through adding it to all the
> existing functions.
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
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).
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 '-'.
Messages sorted by: