From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28905 invoked by alias); 2 Dec 2011 20:33:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16599 Received: (qmail 4956 invoked from network); 2 Dec 2011 20:33:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.43 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 86.6.29.42 Date: Fri, 2 Dec 2011 20:25:24 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: Q: _regex_arguments problem Message-ID: <20111202202524.1849e9d7@pws-pc.ntlworld.com> In-Reply-To: <111202101428.ZM7415@torch.brasslantern.com> References: <20111202131418.GA18623@altlinux.org> <20111202161519.3adb17bf@pwslap01u.europe.root.pri> <20111202173724.GB18623@altlinux.org> <111202101428.ZM7415@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 02 Dec 2011 10:14:28 -0800 Bart Schaefer 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/