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

Re: PATCH: Set index of first non-option argument in _arguments

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