about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2021-04-16 17:33:52 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2021-05-18 02:01:13 +0000
commit6913eb677684e679487ca4462f693d1008052b82 (patch)
treeecc5f1e89b55fe2c4c77cf5de92da7cb173effcd /Doc
parent492c388e1db59a95157a55f58309c9f3997b9a53 (diff)
downloadzsh-6913eb677684e679487ca4462f693d1008052b82.tar.gz
zsh-6913eb677684e679487ca4462f693d1008052b82.tar.xz
zsh-6913eb677684e679487ca4462f693d1008052b82.zip
48601/0001: docs: functions -M: Move an example to be near the specification of the relevant flag
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/builtins.yo13
1 files changed, 6 insertions, 7 deletions
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 022921bfa..03fc69a04 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -924,6 +924,12 @@ opening and matching closing parenthesis is passed to the function as a
 single argument, even if it includes commas or white space.  The minimum
 and maximum argument specifiers must therefore be 1 if given.  An empty
 argument list is passed as a zero-length string.
+Thus, the following string function takes a single argument, including
+the commas, and prints 11:
+
+example(stringfn+LPAR()RPAR() { (( $#1 )) }
+functions -Ms stringfn
+print $(( stringfn+LPAR()foo,bar,rod+RPAR() )))
 
 tt(functions -M) with no arguments lists all such user-defined functions in
 the same form as a definition.  With the additional option tt(-m) and
@@ -941,13 +947,6 @@ For example, the following prints the cube of 3:
 example(zmath_cube+LPAR()RPAR() { (( $1 * $1 * $1 )) }
 functions -M cube 1 1 zmath_cube
 print $(( cube+LPAR()3+RPAR() )))
-
-The following string function takes a single argument, including
-the commas, so prints 11:
-
-example(stringfn+LPAR()RPAR() { (( $#1 )) }
-functions -Ms stringfn
-print $(( stringfn+LPAR()foo,bar,rod+RPAR() )))
 )
 module(getcap)(zsh/cap)
 findex(getln)