Re: [PATCH] cmd:Update HELP text of ’askenv’

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Jun 1 18:41:54 CEST 2021


On 6/1/21 9:09 AM, opensource.kab at gmail.com wrote:
> From: Adarsh Babu Kalepalli <opensource.kab at gmail.com>
>
> Help text of ‘askenv’ cmd is updated
>
> Signed-off-by: Adarsh Babu Kalepalli <opensource.kab at gmail.com>
> ---
>
>   cmd/nvedit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> index d14ba10cef..910cf16aaf 100644
> --- a/cmd/nvedit.c
> +++ b/cmd/nvedit.c
> @@ -1569,7 +1569,7 @@ U_BOOT_CMD(
>   	askenv,	CONFIG_SYS_MAXARGS,	1,	do_env_ask,
>   	"get environment variables from stdin",
>   	"name [message] [size]\n"
> -	"    - get environment variable 'name' from stdin (max 'size' chars)"
> +	"    - display 'message' and get environment variable 'name' from stdin (max 'size' chars)"


Hello Ardash,

thanks for looking for a better description.

This online help does not correctly describe the command syntax yet
which is:

askenv name [message ...] [size]

=> askenv foo
Please enter 'foo': abcdefgh
=> echo $foo
abcdefgh
=>

=> askenv foo 4
Please enter 'foo': abcdefgh
=> echo $foo
abcd
=>

=> askenv foo msg1 msg2 msg3 3
msg1 msg2 msg3 abcdefgh
=> echo $foo
abc
=>

=> askenv foo msg1 msg2 msg3
msg1 msg2 msg3 abcdefgh
=> echo $foo
abcdefgh
=>

The logic needs some explanation. The last parameter is used as size if
it can be converted to a decimal number. In most other commands we
expect a hexadecimal number.

We started adding man-pages for all commands to doc/usage/. Do you want
to give it a try?

Best regards

Heinrich

>   );
>   #endif
>
>


More information about the U-Boot mailing list