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

Re: PATCH: Re: _netscape



Sven Wischnowsky wrote:

> > > Basically, what a helper function needs to do is
> > > take the suffix passed to it and when it is completing a final component
> > > of itself, it should pass any suffix it wants with the one passed to it
> > > appended. Pulling out -S options from "$@" is going to look messy
> > > without some special handling at a lower level somewhere.

> This is so simple to write that I think it's worth adding. So, this
> adds the -E option to zparseopts that can be used to extract options
> from the positional parameters. When combined with -D, the options
> described are actually removed from $*.

On the basis that compadd does only use the first -S option that it is
passed, being able to remove an option is not what is wanted: what is
wanted is a way to separate the first -S option and have it available in
a parameter.

If a helper function is completing only an initial portion of whatever
it completes, it is likely that what it needs to do is use its own
suffix, ignoring any passed to it - this we can do by inserting a new -S
option before the passed args. But, if a helper function is completing
the final portion of whatever it completes, it might want to use as a
suffix, the concatenation of its own suffix with the one which was
passed to it. For this, it would need to extract any suffix passed to it
as opposed to remove it. I'll also need to think about what will happen
with -r options aswell. This -E option well be very useful as it is but
it is not quite what I meant by 'pull out -S options from "$@"'.

Oliver



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