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

Re: Possible to use _arguments with _regex_arguments?



On Wed, Sep 18, 2019 at 1:39 PM Ronan Pigott <rpigott314@xxxxxxxxx> wrote:
>
> When I use '*::message:_myfunc', completion is no longer tripped up by
> options, but _myfunc always acts as if it is completing the first word
> for all normal arguments, as if $words was empty and CURRENT=1 even if
> there are many normal arguments.

I'm not familiar with all the nuances of _regex_arguments, but my
impression from looking through a couple of the places where it is
used is that $words[1] always has to be the command name.  That is, it
always expects to parse a complete command line by catenating $words
back together, so you can't have shifted the command name itself off
the front before you invoke it.  You could probably get away with
shoving a dummy command word onto the front of $words, but I haven't
made any attempt to try it.



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