about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-07-05 17:32:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-07-05 17:32:34 +0000
commitc19aa5da61a02dae8f32a63c280ee1f3bca23604 (patch)
treece7499030358ec4393bc326ef09d05449ab09f6a /Doc
parentf074d050d840b4f41788b53b8b5fcc4aa9075a6d (diff)
downloadzsh-c19aa5da61a02dae8f32a63c280ee1f3bca23604.tar.gz
zsh-c19aa5da61a02dae8f32a63c280ee1f3bca23604.tar.xz
zsh-c19aa5da61a02dae8f32a63c280ee1f3bca23604.zip
15264: improved doc for variant complex commands
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/grammar.yo29
1 files changed, 19 insertions, 10 deletions
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 8b25795d0..ee03febca 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -71,7 +71,7 @@ For example,
 
 example(dmesg | grep panic && print yes)
 
-is a sublist consisting of two piplines, the second just a simple command
+is a sublist consisting of two pipelines, the second just a simple command
 which will be executed if and only if the tt(grep) command returns a zero
 value.  If it does not, the value of the sublist is that return value, else
 it is the value returned by the tt(print) (almost certainly zero).
@@ -203,6 +203,7 @@ cindex(user selection)
 cindex(selection, user)
 item(tt(select) var(name) [ tt(in) var(word) ... var(term) ] tt(do) var(list) tt(done))(
 where var(term) is one or more newline or tt(;) to terminate the var(word)s.
+vindex(REPLY, use of)
 Print the set of var(word)s, each preceded by a number.
 If the tt(in) var(word) is omitted, use the positional parameters.
 The tt(PROMPT3) prompt is printed and a line is read from the line editor
@@ -262,11 +263,16 @@ cindex(commands, alternate forms for complex)
 Many of zsh's complex commands have alternate forms.  These particular
 versions of complex commands should be considered deprecated and may be
 removed in the future.  The versions in the previous section should be
-preferred instead.  The short versions below only work if var(sublist)
-is of the form `tt({) var(list) tt(})' or if the tt(SHORT_LOOPS)
-option is set.  In this case, the test part of the loop must also be
-suitably delimited, such as by `tt([[ ... ]])' or `tt((( ... )))', else
-the end of the test will not be recognized.
+preferred instead.
+
+The short versions below only work if var(sublist) is of the form `tt({)
+var(list) tt(})' or if the tt(SHORT_LOOPS) option is set.  For the tt(if),
+tt(while) and tt(until) commands, in both these cases the test part of the
+loop must also be suitably delimited, such as by `tt([[ ... ]])' or `tt(((
+... )))', else the end of the test will not be recognized.  For the
+tt(for), tt(repeat), tt(case) and tt(select) commands no such special form
+for the arguments is necessary, but the other condition (the special form
+of var(sublist) or use of the tt(SHORT_LOOPS) option) still applies.
 
 startitem()
 item(tt(if) var(list) tt({) var(list) tt(}) [ tt(elif) var(list) tt({) var(list) tt(}) ] ... [ tt(else {) var(list) tt(}) ])(
@@ -286,7 +292,8 @@ example(if true {  # Does not work!
 does em(not), since the test is not suitably delimited.
 )
 item(tt(if) var(list) var(sublist))(
-A short form of the alternate `if'.
+A short form of the alternate `if'.  The same limitations on the form of
+var(list) apply as for the previous form.
 )
 item(tt(for) var(name) tt(LPAR()) var(word) ... tt(RPAR()) var(sublist))(
 A short form of tt(for).
@@ -302,10 +309,12 @@ item(tt(foreach) var(name) tt(LPAR()) var(word) ... tt(RPAR()) var(list) tt(end)
 Another form of tt(for).
 )
 item(tt(while) var(list) tt({) var(list) tt(}))(
-An alternative form of tt(while).
+An alternative form of tt(while).  Note the limitations on the form of
+var(list) mentioned above.
 )
 item(tt(until) var(list) tt({) var(list) tt(}))(
-An alternative form of tt(until).
+An alternative form of tt(until).  Note the limitations on the form of
+var(list) mentioned above.
 )
 item(tt(repeat) var(word) var(sublist))(
 This is a short form of tt(repeat).
@@ -387,5 +396,5 @@ outputs nothing apart from a newline if tt(RC_QUOTES) is not set, but one
 single quote if it is set.
 
 Inside double quotes (tt("")), parameter and
-command substitution occurs, and `tt(\)' quotes the characters
+command substitution occur, and `tt(\)' quotes the characters
 `tt(\)', `tt(`)', `tt(")', and `tt($)'.