[PATCH v2 09/14] doc: Convert command-line info to rST

Simon Glass sjg at chromium.org
Sat Jul 24 17:03:36 CEST 2021


Take this part of the README and put it into rST format.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Add an SPDX header to the file too

 README                | 41 -------------------------------
 doc/usage/cmdline.rst | 56 +++++++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst   |  1 +
 3 files changed, 57 insertions(+), 41 deletions(-)
 create mode 100644 doc/usage/cmdline.rst

diff --git a/README b/README
index 1472b40bc45..fbb8895dbbb 100644
--- a/README
+++ b/README
@@ -3507,47 +3507,6 @@ The signature of the callback functions is:
 
 The return value is 0 if the variable change is accepted and 1 otherwise.
 
-Command Line Parsing:
-=====================
-
-There are two different command line parsers available with U-Boot:
-the old "simple" one, and the much more powerful "hush" shell:
-
-Old, simple command line parser:
---------------------------------
-
-- supports environment variables (through setenv / saveenv commands)
-- several commands on one line, separated by ';'
-- variable substitution using "... ${name} ..." syntax
-- special characters ('$', ';') can be escaped by prefixing with '\',
-  for example:
-	setenv bootcmd bootm \${address}
-- You can also escape text by enclosing in single apostrophes, for example:
-	setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'
-
-Hush shell:
------------
-
-- similar to Bourne shell, with control structures like
-  if...then...else...fi, for...do...done; while...do...done,
-  until...do...done, ...
-- supports environment ("global") variables (through setenv / saveenv
-  commands) and local shell variables (through standard shell syntax
-  "name=value"); only environment variables can be used with "run"
-  command
-
-General rules:
---------------
-
-(1) If a command line (or an environment variable executed by a "run"
-    command) contains several commands separated by semicolon, and
-    one of these commands fails, then the remaining commands will be
-    executed anyway.
-
-(2) If you execute several variables with one call to run (i. e.
-    calling run with a list of variables as arguments), any failing
-    command will cause "run" to terminate, i. e. the remaining
-    variables are not executed.
 
 Note for Redundant Ethernet Interfaces:
 =======================================
diff --git a/doc/usage/cmdline.rst b/doc/usage/cmdline.rst
new file mode 100644
index 00000000000..b3dbdb8b230
--- /dev/null
+++ b/doc/usage/cmdline.rst
@@ -0,0 +1,56 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Command-line Parsing
+====================
+
+The command line is available in U-Boot proper, enabled by CONFIG_CMDLINE which
+is on by default. It is not enabled in SPL.
+
+There are two different command-line parsers available with U-Boot:
+the old "simple" one, and the much more powerful "hush" shell:
+
+Simple command-line parser
+--------------------------
+
+This takes very little code space and offers only basic features:
+
+- supports environment variables (through setenv / saveenv commands)
+- several commands on one line, separated by ';'
+- variable substitution using "... ${name} ..." syntax
+- special characters ('$', ';') can be escaped by prefixing with '\',
+  for example::
+
+    setenv bootcmd bootm \${address}
+
+- You can also escape text by enclosing in single apostrophes, for example::
+
+    setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'
+
+Hush shell
+----------
+
+This is similar to Bourne shell, with control structures like:
+
+- `if`... `then` ... `else`... `fi`
+- `for`... `do` ... `done`
+- `while` ... `do` ... `done`
+- `until` ... `do` ... `done`
+
+Hush supports environment ("global") variables (through setenv / saveenv
+commands) and local shell variables (through standard shell syntax
+`name=value`); only environment variables can be used with the "run" command
+
+The Hush shell is enabled with `CONFIG_HUSH_PARSER`.
+
+General rules
+-------------
+
+#. If a command line (or an environment variable executed by a "run"
+   command) contains several commands separated by semicolon, and
+   one of these commands fails, then the remaining commands will be
+   executed anyway.
+
+#. If you execute several variables with one call to run (i. e.
+   calling run with a list of variables as arguments), any failing
+   command will cause "run" to terminate, i. e. the remaining
+   variables are not executed.
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 40b796a3a91..2d2e8486e67 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -9,6 +9,7 @@ Use U-Boot
    fit
    netconsole
    partitions
+   cmdline
 
 Shell commands
 --------------
-- 
2.32.0.432.gabb21c7263-goog



More information about the U-Boot mailing list