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

Re: completing a comma-separated pair of values



Oliver Kiddle wrote:

> I may have misunderstood this but you can use the return status of
> compset -P directly so that you possibly don't need this. e.g:
> 	if compset -P '*,'; then

Indeed; thanks.  I've also added the optional number 1 to -P, which means
that it'll prevent you from trying to put a second comma on there and
continue completing.

> > The only problem is that (I think) this may need to be completed in a
> > longer series of comma-separated values:
> 
> You can also do a while loop if there's no particular ordering to things
> in the list: while compset -P '*,' Otherwise, use elif for each
> component.

There's an ordering to the arguments of keysource, but not to the list of
things that keysource is in.  So we could have

    foo=64,bar,keysource=passphrase,prompt,baz=true

or
    foo=64,keysource=passphrase,prompt,bar,baz=true

etc.  I want to complete the two comma-separated values after keysource=
with my function, but everything else in this list would be handled
naturally by _values, as if keysource took only a single argument.

Danek



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