Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible to use _arguments with _regex_arguments?
- X-seq: zsh-users 24258
- From: "Ronan Pigott" <rpigott314@xxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: Possible to use _arguments with _regex_arguments?
- Date: Wed, 18 Sep 2019 13:21:38 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:in-reply-to:date:subject:from:to :message-id; bh=zhRTnXN5W73QseozXKG81AC07m+vEhiVoDkmTJApCpo=; b=nnn7VzxAWPBc6nw+SbvIN6MRZEaEtDjNlZfrBfeCorWa3a/ifN0L2pY4yL75b1NSP5 BqXMIXDnT6LLusJrXISHmEyBRf/0Pma+EHAjzbZJDxA7SNElxsWH0oFQY2QCf+O3qgt7 uoVmgLFVpy4W5Z7ZlNWrY9rR4+S5jZLSwt7luCPK16bKGyo6JKf2oi4+PR3z92cFpByI sw1m0w0Cm49Ii7OAcxCpq4+53mD7eHqI27Qi8K65aJ//Y47JsSOVBv4+qxvyyJRU4v0J bDfOl11GSI799pokZu45aQa2akxINTdG99Os5pWoonzwJSR0O1clSZNSFEq3Q7db3D8+ z5Fw==
- In-reply-to: <BX2RX80O9EQW.26O4G1RH2WSIK@rxps>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
On Tue Sep 17, 2019 at 7:31 PM Ronan Pigott wrote:
> One thing I thought to try was set '{words=("$line[@]"); _myfunc}' for
> the action, but it did not seem to work.
>
> If it cannot be done, is there another way that I can transform the line
> to be completed before running (or re-running) the completion to make
> this idea possible?
I've since found that _arguments itself has the ability to transform the
words and CURRENT special parameters by specifying the argument like:
'*::message:action', but unfortunately it still does not produce the
desired result when 'action' is a function generated by
_regex_arguments. Can anyone explain the behavior I see?
What I observe is that when _myfunc is created by _regex_arguments, and
the command argument is passed to _arguments like so: '*:message:_myfunc'
`command arg1 arg2` is completed correctly as expected by _myfunc
`command -o option arg1` is offered no completions by _myfunc, as it
does not match.
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 looking for a way to have _myfunc
when invoked as an action of _arguments see only (and all of) the normal
arguments, but for some reason the _regex_arguments functions don't seem
to behave that way.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author