diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-05 12:06:30 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-05 12:06:30 +0000 |
commit | 80ac43783a990ecb1e5234e3d7a682508102e42f (patch) | |
tree | 2ace88d6cbd969dd1f1d766b9802ad6844c7157c /Doc/Zsh/compsys.yo | |
parent | b8bdb144d2a310632efb3bbd7dd78d4f296bc62f (diff) | |
download | zsh-80ac43783a990ecb1e5234e3d7a682508102e42f.tar.gz zsh-80ac43783a990ecb1e5234e3d7a682508102e42f.tar.xz zsh-80ac43783a990ecb1e5234e3d7a682508102e42f.zip |
support automatically inserted dummy in $words
Diffstat (limited to 'Doc/Zsh/compsys.yo')
-rw-r--r-- | Doc/Zsh/compsys.yo | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 3cb9e4ff8..035a98e0d 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -2497,7 +2497,7 @@ using the var(specs) which are of the form: using tt(_tags) and if the tag is requested, the var(action) is executed with the given var(descr) (description). The var(action)s supported are those used by the tt(_arguments) function (described -below), without the `tt(->)var(state)' form. +below), without the `tt(->)var(state)' and `tt(=)var(...)' forms. For example, the var(action) may be a simple function call. With that one could do: @@ -2794,6 +2794,23 @@ are taken from the array parameter tt(expl) which will be set up before executing the var(action) and hence may be used in it (normally in an expansion like `tt($expl[@])'). +If the var(action) starts with `tt(= )' (a equal sign followed by a +space), tt(_arguments) will insert the contents of the var(argument) +field of the current context as the new first element in the tt(words) +special array and increments the value of the tt(CURRENT) special +parameter. In other words, it inserts a dummy element in the tt(words) +array and makes tt(CURRENT) still point to the word in that array +where the cursor is. This is only really useful when used with one of +the forms that make tt(_arguments) modify the tt(words) array to +contain only some of the words from the line, i.e. one of the argument +description forms where the var(message) is preceded by two or three +colons. For example, when the function called in the action for such +an argument itself uses tt(_arguments), the dummy element is needed to +make that second call to tt(_arguments) use all words from the +restricted range for argument parsing. Without the inserted dummy +element, the first word in the range would be taken (by the second +tt(_arguments)) to be the command name and hence ignored. + Except for the `tt(->)var(string)' form, the var(action) will be executed by calling the tt(_all_labels) function to process all tag labels, so one doesn't need to call that explicitly unless another tag is to |