From 52f25ab3d2d81a7c3172a54e3c0824de40b30270 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Mon, 29 Oct 2007 20:13:58 +0000 Subject: Merge of 22780: _arguments -n sets NORMARG to index of first non-option argument (via comparguments -n). --- Doc/Zsh/compsys.yo | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 1a81eea3f..f65f15223 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3237,12 +3237,21 @@ Like tt(_tags) this function supports the tt(-C) option to give a different name for the argument context field. ) findex(_arguments) -item(tt(_arguments) [ tt(-swWACRS) ] [ tt(-O) var(name) ] [ tt(-M) var(matchspec) ] [ tt(:) ] var(spec) ...)( +item(tt(_arguments) [ tt(-nswWACRS) ] [ tt(-O) var(name) ] [ tt(-M) var(matchspec) ] [ tt(:) ] var(spec) ...)( This function can be used to give a complete specification for completion for a command whose arguments follow standard UNIX option and argument conventions. The following forms specify individual sets of options and arguments; to avoid ambiguity, these may be separated from the -options to tt(_arguments) itself by a single colon. +options to tt(_arguments) itself by a single colon. Options to +tt(_arguments) itself must be in separate words, i.e. tt(-s -w), not +tt(-sw). + +With the option tt(-n), tt(_arguments) sets the parameter tt(NORMARG) +to the position of the first normal argument in the tt($words) array, +i.e. the position after the end of the options. If that argument +has not been reached, tt(NORMARG) is set to tt(-1). The caller +should declare `tt(integer NORMARG)' if the tt(-n) option is passed; +otherwise the parameter is not used. startitem() xitem(var(n)tt(:)var(message)tt(:)var(action)) -- cgit 1.4.1