about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2024-02-19 11:10:04 +0000
committerPeter Stephenson <p.stephenson@samsung.com>2024-02-19 11:10:04 +0000
commita6ea12286709273e7896916dc8a107cd52f01d26 (patch)
treed23a4a639cfa4e304e343c0569031194c30fc225
parentd2f63d0d92f17d935787e6b0d39d89fe591fa910 (diff)
downloadzsh-a6ea12286709273e7896916dc8a107cd52f01d26.tar.gz
zsh-a6ea12286709273e7896916dc8a107cd52f01d26.tar.xz
zsh-a6ea12286709273e7896916dc8a107cd52f01d26.zip
52549: document return works in a script
-rw-r--r--ChangeLog7
-rw-r--r--Doc/Zsh/builtins.yo4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ed8e919d..e3762340a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2024-02-19  Jun-ichi Takimoto  <takimoto-j@kba.biglobe.ne.jp>
+2024-02-19  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 52549: Doc/Zsh/builtins.yo: document that return already works
+	in a script.
+
+x2024-02-19  Jun-ichi Takimoto  <takimoto-j@kba.biglobe.ne.jp>
 
 	* 52544: Completion/Unix/Type/_diff_options: support macOS Ventura
 	or newer
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 1aa807633..7a8654f27 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1649,7 +1649,9 @@ cindex(functions, returning from)
 item(tt(return) [ var(n) ])(
 Causes a shell function or `tt(.)' script to return to
 the invoking script with the return status specified by
-an arithmetic expression var(n).  
+an arithmetic expression var(n).  Also causes a non-interctive
+shell to exit, allowing files containing shell code to be used
+both as scripts and as autoloadable shell functions.
 For example, the following prints `tt(42)':
 
 example(() { integer foo=40; return "foo + 2" }