You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/10/18 15:32:17 UTC

(nuttx) branch master updated: Documentation/nsh: Describe the exit status argument of exit.

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 92f02edb15e Documentation/nsh: Describe the exit status argument of exit.
92f02edb15e is described below

commit 92f02edb15e46ee9db9abfdb9503799ce5d687e9
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Sun Oct 18 16:54:09 2026 +0200

    Documentation/nsh: Describe the exit status argument of exit.
    
    The NSH exit command now takes an optional exit status from 0 to 255.
    Show it in the syntax and say what it is for.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
 Documentation/applications/nsh/commands.rst | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/applications/nsh/commands.rst b/Documentation/applications/nsh/commands.rst
index 5c0a44f4916..9ef0824e374 100644
--- a/Documentation/applications/nsh/commands.rst
+++ b/Documentation/applications/nsh/commands.rst
@@ -601,13 +601,16 @@ executed in background via ``exec <hex-address> &``.
 
 **Command Syntax**::
 
-  exit
+  exit [<status>]
 
 **Synopsis**. Exit NSH. Only useful for the serial front end if
 you have started some other tasks (perhaps using the ``exec``
 command) and you would like to have NSH out of the way. For the
 telnet front-end, ``exit`` terminates the telnet session.
 
+``<status>`` is the exit status of NSH, from 0 to 255. The default is
+0. A script or ``sh -c`` can use it to report a failure.
+
 .. _cmdexport:
 
 ``export`` Set an Environment Variable