Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Set index of first non-option argument in _arguments
- X-seq: zsh-workers 22782
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: PATCH: Set index of first non-option argument in _arguments
- Date: Wed, 27 Sep 2006 18:09:05 +0100
- In-reply-to: <200609271629.k8RGTkll031019@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200609271629.k8RGTkll031019@xxxxxxxxxxxxxx>
Peter Stephenson wrote:
> One thing that's annoyed me about _arguments (let's stick at that for now,
> shall we?) is that although it, or rather the comparguments builtin,
> knows perfectly well where the first argument after the options
> started, it won't tell you. This makes it unnecessarily difficult to
> handle commands with subcommands with different arguments (such as cvs
> or svn); you basically have to reparse the command line yourself to do
> it properly.
To be scrupulous: that's not entirely true. There's an option
*::: to limit the words in the completion array to just the arguments.
However, that's not necessarily flexible enough. What probably would
have been would be looking at the context which should be set to
include argument-N, and that N is just CURRENT - NORMARG + 1.
Still, I've done it now.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author