zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: Q: _regex_arguments problem
Date: Fri, 2 Dec 2011 20:25:24 +0000	[thread overview]
Message-ID: <20111202202524.1849e9d7@pws-pc.ntlworld.com> (raw)
In-Reply-To: <111202101428.ZM7415@torch.brasslantern.com>

On Fri, 02 Dec 2011 10:14:28 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Dec 2,  9:37pm, Alexey I. Froloff wrote:
> }
> } I've found so far, that the only utility function, that can
> } complete anything-but-space-separated list of values is _values.
> } And it accepts only predefined values.  My list of ids is not
> } static, it is fetched from remote server via executing special
> } ssh command, so I guess this problem is not related to _regex_*
> } completion, this is just not possible...
> 
> The typical way you'd do this with the plain _arguments function
> is with the ->state mechanism:  use _arguments to figure out the
> context and set a state, then in a 'case' or the like on the state
> value you call your ssh command to get the list of values and then
> call _values with that.

The documentation says the actions supported by _regex_arguments are the
same as those supported by _arguments, although I didn't try it; in nay
case I don't see why you shouldn't use a function to complete for the
context, either.

You'll probably need to make _regex_arguments skip up to the last comma,
so you don't need to figure out a valid last of values until you know
you're trying to complete one.  I think _ip does that sort of thing.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2011-12-02 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 13:14 Alexey I. Froloff
2011-12-02 15:45 ` Bart Schaefer
2011-12-02 16:15 ` Peter Stephenson
2011-12-02 17:37   ` Alexey I. Froloff
2011-12-02 18:14     ` Bart Schaefer
2011-12-02 20:25       ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111202202524.1849e9d7@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).