All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: "Eugeniu Rosca" <erosca@de.adit-jv.com>,
	"Roland Gaudig" <roland.gaudig@weidmueller.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Stefan Herbrechtsmeier" <stefan.herbrechtsmeier@weidmueller.com>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Tom Rini" <trini@konsulko.com>, "Marek Vasut" <marex@denx.de>,
	"Simon Glass" <sjg@chromium.org>
Subject: [PATCH 09/15] doc: Convert command-line info to rST
Date: Tue, 20 Jul 2021 07:29:33 -0600	[thread overview]
Message-ID: <20210720132940.1171011-10-sjg@chromium.org> (raw)
In-Reply-To: <20210720132940.1171011-1-sjg@chromium.org>

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

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

 README                | 41 --------------------------------
 doc/usage/cmdline.rst | 54 +++++++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst   |  1 +
 3 files changed, 55 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..c7008d646c9
--- /dev/null
+++ b/doc/usage/cmdline.rst
@@ -0,0 +1,54 @@
+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.402.g57bb445576-goog


  parent reply	other threads:[~2021-07-20 13:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 13:29 [PATCH 00/15] lib: Add support for a decimal 0m prefix for numbers Simon Glass
2021-07-20 13:29 ` [PATCH 01/15] hash: Ensure verification hex pairs are terminated Simon Glass
2021-07-20 13:29 ` [PATCH 02/15] global: Convert simple_strtoul() with hex to hextoul() Simon Glass
2021-07-20 13:29 ` [PATCH 03/15] global: Convert simple_strtoul() with decimal to dectoul() Simon Glass
2021-07-20 13:29 ` [PATCH 04/15] lib: Comment the base parameter with simple_strtoul/l() Simon Glass
2021-07-20 13:29 ` [PATCH 05/15] lib: Drop unnecessary check for hex digit Simon Glass
2021-07-20 13:29 ` [PATCH 06/15] lib: Add tests for simple_strtoull() Simon Glass
2021-07-20 13:29 ` [PATCH 07/15] lib: Add octal tests for simple_strtoul/l() Simon Glass
2021-07-20 13:29 ` [PATCH 08/15] lib: Move common digit-parsing code into a function Simon Glass
2021-07-20 13:29 ` Simon Glass [this message]
2021-07-20 13:29 ` [PATCH 10/15] doc: Add a note about number representation Simon Glass
2021-07-20 13:29 ` [PATCH 11/15] lib: Allow using 0x when a decimal value is requested Simon Glass
2021-07-20 13:29 ` [PATCH 12/15] lib: Support a decimal prefix 0m Simon Glass
2021-07-20 13:29 ` [PATCH 13/15] RFC: lib: Support a binary prefix 0y Simon Glass
2021-07-21  8:05   ` Sean Anderson
2021-07-21  8:30     ` Wolfgang Denk
2021-07-21  8:27   ` Wolfgang Denk
2021-07-21 14:23     ` Simon Glass
2021-07-22  9:48       ` Wolfgang Denk
2021-07-22 13:28         ` Simon Glass
2021-07-22 14:44           ` Tom Rini
2021-07-23  3:07             ` Simon Glass
2021-07-23  6:55           ` Wolfgang Denk
2021-07-23 21:41             ` Simon Glass
2021-07-24 13:00               ` Wolfgang Denk
2021-07-20 13:29 ` [PATCH 14/15] RFC: lib: Use 0o prefix for octal Simon Glass
2021-07-20 13:29 ` [PATCH 15/15] RFC: Change simple_strtoul() et al to default to hex Simon Glass
2021-07-20 14:22 ` [PATCH 00/15] lib: Add support for a decimal 0m prefix for numbers Tom Rini
2021-07-20 15:57   ` Simon Glass
2021-07-20 16:05     ` Tom Rini
2021-07-20 16:30       ` Eugeniu Rosca
2021-07-20 18:33       ` Simon Glass
2021-07-20 19:28         ` Tom Rini
2021-07-21 13:57           ` Simon Glass
2021-07-21  7:52       ` Wolfgang Denk
2021-07-21 14:46         ` Simon Glass
2021-07-23 21:41           ` Simon Glass
2021-07-20 15:00 ` Jonathan A. Kollasch
2021-07-20 15:04   ` Tom Rini
2021-07-21  7:42 ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210720132940.1171011-10-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=erosca@de.adit-jv.com \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=roland.gaudig@weidmueller.com \
    --cc=seanga2@gmail.com \
    --cc=stefan.herbrechtsmeier@weidmueller.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.