summary refs log tree commit diff
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2007-09-25 22:47:25 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2007-09-25 22:47:25 +0800
commit474d2cdd444ea4cb1f1f028ac8faecc1abae35f9 (patch)
tree1abf2336e2051603b8a48d8b1ee123f461854c3d
parent[MAN] Clarify description of -nt, -ot options to test builtin (diff)
downloaddash-474d2cdd444ea4cb1f1f028ac8faecc1abae35f9.tar.gz
dash-474d2cdd444ea4cb1f1f028ac8faecc1abae35f9.zip
[MAN] Clarify syntax of the for command
Document that in a for loop 'in word ...' is optional, and if omitted,
'in "$@"' is used.

Lars Wilke noticed this, and reported through
 http://bugs.debian.org/387441
-rw-r--r--ChangeLog1
-rw-r--r--src/dash.17
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ea7374..003a0f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-09-25  Gerrit Pape <pape@smarden.org>
 
 	* Clarify description of -nt, -ot options to test builtin.
+	* Clarify syntax of the for command.
 
 2007-09-25  Herbert Xu <herbert@gondor.apana.org.au>
 
diff --git a/src/dash.1 b/src/dash.1
index 3aefe21..9b8ab0e 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -640,17 +640,20 @@ repeat until the exit status of the first list is zero.
 .Pp
 The syntax of the for command is
 .Bd -literal -offset indent
-for variable in word ...
+for variable [ in [ word ... ] ]
 do   list
 done
 .Ed
 .Pp
-The words are expanded, and then the list is executed repeatedly with the
+The words following
+.Pa in
+are expanded, and then the list is executed repeatedly with the
 variable set to each word in turn.
 do and done may be replaced with
 .Dq {
 and
 .Dq } .
+Omitting in word ... is equivalent to in "$@".
 .Pp
 The syntax of the break and continue command is
 .Bd -literal -offset indent
8-25 13:21:48 -0400'>2019-08-25Remove files from cards repoJune McEnroe 2019-08-22Add READMEJune McEnroe 2019-08-22Add exampleJune McEnroe 2019-08-22Add FILES sectionJune McEnroe 2019-08-22Remove gamesJune McEnroe 2019-04-04Mark card functions inlineJune McEnroe 2019-04-04Add listClearJune McEnroe 2019-04-03Tweak mouseButtonUp code a bitJune McEnroe 2019-04-03Check gameAvail on double-clickJune McEnroe 2019-04-02Select and move cards on mouse upJune McEnroe 2019-04-01Add idSkipJune McEnroe 2019-03-31Fix weird typoJune McEnroe 2019-03-30Add undo to freecellJune McEnroe 2019-03-29Replace path.h with asset.hJune McEnroe 2019-03-29Add king win faceJune McEnroe 2019-03-29Change king face directionJune McEnroe 2019-03-29Load king bitmaps in freecellJune McEnroe