From: opensource.kab@gmail.com
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
Adarsh Babu Kalepalli <opensource.kab@gmail.com>
Subject: [PATCH] doc/usage: cmd-usage help file for askenv
Date: Fri, 11 Jun 2021 19:45:11 +0530 [thread overview]
Message-ID: <20210611141511.3942-1-opensource.kab@gmail.com> (raw)
From: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
help file for using askenv cmd is created.
It provides description on the command purpose,
description of arguments,
couple of examples (illustrating command usage),
configuration parameter and
possible return values.
Signed-off-by: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
---
doc/usage/askenv.rst | 87 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 doc/usage/askenv.rst
diff --git a/doc/usage/askenv.rst b/doc/usage/askenv.rst
new file mode 100644
index 0000000000..5c4ca35d4c
--- /dev/null
+++ b/doc/usage/askenv.rst
@@ -0,0 +1,87 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+askenv command
+===============
+
+Synopsis
+--------
+
+::
+
+ askenv name [message] [size]
+
+Description
+-----------
+
+Display message and get environment variable name of max size characters
+from stdin.
+
+name
+ name of the environment variable
+
+message
+ message is displayed while the command waits for the value to be
+ entered from stdin.if no message is specified,a default message
+ "Please enter name:" will be displayed.
+
+size
+ maximum number of characters that will be stored in environment
+ variable name.this is in decimal number format (unlike in
+ other commands where size values are in hexa-decimal). Default
+ value of size is 1023 (CONFIG_SYS_CBSIZE - 1).
+
+Example
+-------
+
+Value of a environment variable env1 without message and size parameters:
+
+::
+
+ => askenv env1;echo $?
+ Please enter 'env1': val1
+ 0
+ => printenv env1
+ env1=val1
+
+Value of a environment variable env2 with message and size parameters:
+
+::
+
+ => askenv env2 Please type-in a value for env2: 10;echo $?
+ Please type-in a value for env2: 1234567890123
+ 0
+ => printenv env2
+ env2=1234567890
+
+Value of a environment variable env3 with size parameter only:
+
+::
+
+ => askenv env3 10;echo $?
+ Please enter 'env3': val3
+ 0
+ => printenv env3
+ env3=val3
+
+Return Value of askenv command, when used without any other arguments:
+
+::
+
+ => askenv;echo $?
+ askenv - get environment variables from stdin
+
+ Usage:
+ askenv name [message] [size]
+ - display 'message' and get environment variable 'name' from stdin (max 'size' chars)
+ 1
+
+Configuration
+-------------
+
+The askenv command is only available if CMD_ASKENV=y
+
+Return value
+------------
+
+The return value $? is set to 0 (true).
+If no other arguments are specified (along with askenv), it is set to 1 (false).
--
2.17.1
reply other threads:[~2021-06-11 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210611141511.3942-1-opensource.kab@gmail.com \
--to=opensource.kab@gmail.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox