doc: Add a general note about $?
v2 cover doc: Add a general note about $?
Hey all,
This is v2 of a small series to first add a general explanation for how $? is set by commands to the cmdline documentation and second remove the redundant information. Changes from the first version are adding Quentin's tags and rewording the added section as I was incorrect about how invalid syntax is passed along to the user (-1 is used in the API only). The first patch adds this new text while removing the identical (and sometimes incomplete) information from commands which had it. The last two patches remove the information from cases that were not quite as clear, to make review easier. The commands which either do something different or provided additional information about what counts as success or failure have been retained.
Signature · 1 line
Tom
PATCH v2 1/3 doc: usage: Add general rule for `$?`
For nearly all commands in U-Boot the '?' variable is handled the same way with 0 meaning success, 1 meaning any failure. Explain this in the general rules section of the cmdline documentation (with a link to a counter example) and then remove the redundant wording from most commands. We retain a section about the return value in a number of places where we are doing something such as always returning a specific value or we have useful additional information to go along with the normal return codes.
---
Changes in v2:
- Rewordings suggested by Quentin
- After confirming that invalid syntax also always returns 1 and not -1, reword the paragraph and commit message
--- doc/usage/cmd/armffa.rst | 5 ----- doc/usage/cmd/bdinfo.rst | 5 ----- doc/usage/cmd/bind.rst | 5 ----- doc/usage/cmd/blkcache.rst | 6 ------ doc/usage/cmd/cat.rst | 5 ----- doc/usage/cmd/cli.rst | 5 ----- doc/usage/cmd/cls.rst | 5 ----- doc/usage/cmd/cp.rst | 6 ------ doc/usage/cmd/cpu.rst | 6 ------ doc/usage/cmd/cpuid.rst | 5 ----- doc/usage/cmd/dmareset.rst | 6 ------ doc/usage/cmd/ebtupdate.rst | 6 ------ doc/usage/cmd/fatinfo.rst | 6 ------ doc/usage/cmd/fdt.rst | 5 ----- doc/usage/cmd/font.rst | 6 ------ doc/usage/cmd/fuse.rst | 6 ------ doc/usage/cmd/gpio.rst | 6 ------ doc/usage/cmd/host.rst | 6 ------ doc/usage/cmd/i3c.rst | 6 ------ doc/usage/cmd/imxtract.rst | 6 ------ doc/usage/cmd/loadb.rst | 5 ----- doc/usage/cmd/loadm.rst | 7 ------- doc/usage/cmd/loads.rst | 5 ----- doc/usage/cmd/loadx.rst | 5 ----- doc/usage/cmd/loady.rst | 5 ----- doc/usage/cmd/msr.rst | 5 ----- doc/usage/cmd/mtest.rst | 5 ----- doc/usage/cmd/optee.rst | 5 ----- doc/usage/cmd/part.rst | 6 ------ doc/usage/cmd/pause.rst | 6 ------ doc/usage/cmd/pinmux.rst | 6 ------ doc/usage/cmd/pwm.rst | 6 ------ doc/usage/cmd/saves.rst | 5 ----- doc/usage/cmd/scmi.rst | 7 ------- doc/usage/cmd/setexpr.rst | 7 ------- doc/usage/cmd/size.rst | 6 ------ doc/usage/cmd/smbios.rst | 5 ----- doc/usage/cmd/sound.rst | 5 ----- doc/usage/cmd/source.rst | 6 ------ doc/usage/cmd/temperature.rst | 6 ------ doc/usage/cmd/tftpput.rst | 5 ----- doc/usage/cmd/unbind.rst | 5 ----- doc/usage/cmd/wdt.rst | 5 ----- doc/usage/cmd/wget.rst | 5 ----- doc/usage/cmdline.rst | 6 ++++++ 45 files changed, 6 insertions(+), 245 deletions(-)
doc/usage/cmd/armffa.rst +0 -5
@@ -90,8 +90,3 @@ Configuration ------------- The command is available if CONFIG_CMD_ARMFFA=y and CONFIG_ARM_FFA_TRANSPORT=y. - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) on failure.
doc/usage/cmd/bdinfo.rst +0 -5
@@ -115,8 +115,3 @@ Configuration ------------- The bdinfo command is available if CONFIG_CMD_BDI=y. - -Return code ------------ - -The return code $? is 0 (true).
doc/usage/cmd/bind.rst +0 -5
@@ -99,8 +99,3 @@ Configuration ------------- The bind command is only available if CONFIG_CMD_BIND=y. - -Return code ------------ - -The return code $? is 0 (true) on success and 1 (false) on failure.
doc/usage/cmd/blkcache.rst +0 -6
@@ -69,9 +69,3 @@ Configuration ------------- The blkcache command is only available if CONFIG_CMD_BLOCK_CACHE=y. - -Return code ------------ - -If the command succeeds, the return code $? is set 0 (true). In case of an -error the return code is set to 1 (false).
doc/usage/cmd/cat.rst +0 -5
@@ -45,8 +45,3 @@ Configuration ------------- The cat command is only available if CONFIG_CMD_CAT=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the file is readable, otherwise it returns a non-zero error code.
doc/usage/cmd/cli.rst +0 -5
@@ -70,8 +70,3 @@ compiled:: modern => cli set old Want to set current parser to old, but its code was not compiled! - -Return value ------------- - -The return value $? indicates whether the command succeeded.
doc/usage/cmd/cls.rst +0 -5
@@ -22,8 +22,3 @@ Configuration ------------- The cls command is only available if CONFIG_CMD_CLS=y. - -Return value ------------- - -The return value $? is 0 (true) on success and 1 (false) on failure.
doc/usage/cmd/cp.rst +0 -6
@@ -79,9 +79,3 @@ Configuration The cp command is available if CONFIG_CMD_MEMORY=y. Support for 64 bit words (cp.q) is only available on 64-bit targets. Copying to flash depends on CONFIG_MTD_NOR_FLASH=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the command was successfully, -1 (false) otherwise.
doc/usage/cmd/cpu.rst +0 -6
@@ -93,9 +93,3 @@ Configuration ------------- The cpu command is available if CONFIG_CMD_CPU=y. - -Return code ------------ - -The return value $? is set to 0 (true) if the command is successful, -1 (false) otherwise.
doc/usage/cmd/cpuid.rst +0 -5
@@ -25,11 +25,6 @@ Configuration The cpuid command is only available on x86. -Return value ------------- - -The return value $? is 0 (true). - Example -------
doc/usage/cmd/dmareset.rst +0 -6
@@ -47,9 +47,3 @@ Configuration The dmareset command is only available if CONFIG_CMD_C5_PL330_DMA=y in "Shell scripting commands". - -Return value ------------- - -If the command succeeds, the return value $? is set to 0 (true). -If an error occurs, the return value $? is set to 1 (false).
doc/usage/cmd/ebtupdate.rst +0 -6
@@ -64,9 +64,3 @@ Configuration The ebtupdate command is only available if CONFIG_CMD_EBTUPDATE=y and only on Tegra 2 and Tegra 3 configurations. - -Return value ------------- - -The return value $? is set to 0 (true) if everything went successfully. If an -error occurs, the return value $? is set to 1 (false).
doc/usage/cmd/fatinfo.rst +0 -6
@@ -46,9 +46,3 @@ Configuration ------------- The fatinfo command is only available if CONFIG_CMD_FAT=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the partition is a FAT partition. -Otherwise it is set to 1 (false).
doc/usage/cmd/fdt.rst +0 -5
@@ -66,8 +66,3 @@ address and expand it to 0xf000 in size:: Working FDT set to 10000 => md 10000 4 00010000: edfe0dd0 00f00000 78000000 7c270000 ...........x..'| - -Return value ------------- - -The return value $? indicates whether the command succeeded.
doc/usage/cmd/font.rst +0 -6
@@ -54,9 +54,3 @@ Configuration ------------- The command is only available if CONFIG_CONSOLE_TRUETYPE=y. - -Return value ------------- - -The return value $? is 0 (true) if the command completes. -The return value is 1 (false) if the command fails.
doc/usage/cmd/fuse.rst +0 -6
@@ -168,9 +168,3 @@ Configuration The fuse commands are available if CONFIG_CMD_FUSE=y. The fuse writebuff command is available if CONFIG_CMD_FUSE_WRITEBUFF=y. - -Return code ------------ - -The return value $? is set to 0 (true) if the command is successful, -1 (false) otherwise.
doc/usage/cmd/gpio.rst +0 -6
@@ -127,9 +127,3 @@ Configuration The *gpio* command is only available if CONFIG_CMD_GPIO=y. The *gpio read* command is only available if CONFIG_CMD_GPIO_READ=y. - -Return value ------------- - -If the command succeds the return value $? is set to 0. If an error occurs, the -return value $? is set to 1.
doc/usage/cmd/host.rst +0 -6
@@ -111,9 +111,3 @@ Unbind a device:: => host info dev blocks label path 1 2048 fat 1MB.fat32.img - - -Return value ------------- - -The return value $? indicates whether the command succeeded.
doc/usage/cmd/i3c.rst +0 -6
@@ -129,12 +129,6 @@ Configuration The ``i3c`` command is only available if CONFIG_CMD_I3C=y. -Return value ------------- - -If the command succeeds, the return value ``$?`` is set to 0. If an error -occurs, the return value ``$?`` is set to 1. - Note ----
doc/usage/cmd/imxtract.rst +0 -6
@@ -76,9 +76,3 @@ Configuration The imxtract command is only available if CONFIG_CMD_XIMG=y. Support for FIT images requires CONFIG_FIT=y. Support for legacy U-Boot images requires CONFIG_LEGACY_IMAGE_FORMAT=y. - -Return value ------------- - -On success the return value $? of the command is 0 (true). On failure the -return value is 1 (false).
doc/usage/cmd/loadb.rst +0 -5
@@ -66,8 +66,3 @@ Configuration ------------- The command is only available if CONFIG_CMD_LOADB=y. - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) on error.
doc/usage/cmd/loadm.rst +0 -7
@@ -43,10 +43,3 @@ Configuration ------------- The command is only available if CONFIG_CMD_LOADM=y. - -Return value ------------- - -The return value $? is set 0 (true) if the loading is succefull, and -is set to 1 (false) in case of error. -
doc/usage/cmd/loads.rst +0 -5
@@ -92,8 +92,3 @@ Configuration The command is only available if CONFIG_CMD_LOADS=y. The parameter to set the baud rate is only available if CONFIG_SYS_LOADS_BAUD_CHANGE=y - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) otherwise.
doc/usage/cmd/loadx.rst +0 -5
@@ -73,8 +73,3 @@ The command is only available if CONFIG_CMD_LOADB=y. Initial timeout in seconds while waiting for transfer is configured by config option CMD_LOADXY_TIMEOUT or by env variable $loadxy_timeout. Setting it to 0 means infinite timeout. - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) otherwise.
doc/usage/cmd/loady.rst +0 -5
@@ -70,8 +70,3 @@ The command is only available if CONFIG_CMD_LOADB=y. Initial timeout in seconds while waiting for transfer is configured by config option CMD_LOADXY_TIMEOUT or by env variable $loadxy_timeout. Setting it to 0 means infinite timeout. - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) otherwise.
doc/usage/cmd/msr.rst +0 -5
@@ -38,11 +38,6 @@ Configuration The msr command is only available on x86. -Return value ------------- - -The return value $? is 0 (true). - Example -------
doc/usage/cmd/mtest.rst +0 -5
@@ -62,8 +62,3 @@ Configuration ------------- The mtest command is enabled by CONFIG_CMD_MEMTEST=y. - -Return value ------------- - -The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.
doc/usage/cmd/optee.rst +0 -5
@@ -63,8 +63,3 @@ Configuration ------------- The optee command is enabled by CONFIG_OPTEE=y and CONFIG_CMD_OPTEE=y. - -Return value ------------- - -The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.
doc/usage/cmd/part.rst +0 -6
@@ -223,9 +223,3 @@ This shows looking at a device with multiple partition tables:: type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: a0891d7e-b930-4513-94da-f629dbd637b2 => - -Return value ------------- - -The return value $? is set to 0 (true) if the command succededd. If an -error occurs, the return value $? is set to 1 (false).
doc/usage/cmd/pause.rst +0 -6
@@ -48,9 +48,3 @@ Note that complex prompts require proper quoting: Usage: pause [prompt] - Wait until users presses any key. [prompt] can be used to customize the message. - -Return value ------------- - -The return value $? is always set to 0 (true), unless invoked in an invalid -manner.
doc/usage/cmd/pinmux.rst +0 -6
@@ -90,9 +90,3 @@ Configuration ------------- The pinmux command is only available if CONFIG_CMD_PINMUX=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the command succeded and to 1 (false) -otherwise.
doc/usage/cmd/pwm.rst +0 -6
@@ -83,9 +83,3 @@ Configuration ------------- The ``pwm`` command is only available if CONFIG_CMD_PWM=y. - -Return value ------------- - -If the command succeeds, the return value ``$?`` is set to 0. If an error occurs, the -return value ``$?`` is set to 1.
doc/usage/cmd/saves.rst +0 -5
@@ -84,8 +84,3 @@ Configuration The command is only available if CONFIG_CMD_SAVES=y. The parameter to set the baud rate is only available if CONFIG_SYS_LOADS_BAUD_CHANGE=y - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) otherwise.
doc/usage/cmd/scmi.rst +0 -7
@@ -119,11 +119,4 @@ Configuration The scmi command is only available if CONFIG_CMD_SCMI=y. Default n because this command is mainly for debug purpose. -Return value ------------- - -The return value ($?) is set to 0 if the operation succeeded, -1 if the operation failed or -1 if the operation failed due to -a syntax error. - .. _`SCMI specification`: https://developer.arm.com/documentation/den0056/e/?lang=en
doc/usage/cmd/setexpr.rst +0 -7
@@ -147,10 +147,3 @@ Configuration * The *setexpr gsub* and *setexpr sub* sub-commands are only available if CONFIG_REGEX=y. For an overview of the supported regex syntax, see :doc:`test`. - -Return value ------------- - -The return value $? is set to 0 (true) if the operation was successful. - -If an error occurs, the return value $? is set to 1 (false).
doc/usage/cmd/size.rst +0 -6
@@ -35,9 +35,3 @@ Configuration ------------- The size command is only available if CONFIG_CMD_FS_GENERIC=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the command succeded and to 1 (false) -otherwise.
doc/usage/cmd/smbios.rst +0 -5
@@ -86,8 +86,3 @@ Configuration ------------- The command is only available if CONFIG_CMD_SMBIOS=y. - -Return value ------------- - -The return value $? is 0 (true) on success, 1 (false) otherwise.
doc/usage/cmd/sound.rst +0 -5
@@ -56,8 +56,3 @@ Configuration ------------- The sound command is enabled by CONFIG_CMD_SOUND=y. - -Return value ------------- - -The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.
doc/usage/cmd/source.rst +0 -6
@@ -188,9 +188,3 @@ The FIT image file format requires CONFIG_FIT=y.# The legacy U-Boot image file format requires CONFIG_LEGACY_IMAGE_FORMAT=y. On hardened systems support for the legacy U-Boot image format should be disabled as these images cannot be signed and verified. - -Return value ------------- - -If the scripts is executed successfully, the return value $? is 0 (true). -Otherwise it is 1 (false).
doc/usage/cmd/temperature.rst +0 -6
@@ -45,9 +45,3 @@ Configuration ------------- The *temperature* command is only available if CONFIG_CMD_TEMPERATURE=y. - -Return value ------------- - -The return value $? is set to 0 (true) if the command succeeded and to 1 (false) -otherwise.
doc/usage/cmd/tftpput.rst +0 -5
@@ -79,8 +79,3 @@ after which an ACK response is required. The window size defaults to 1. If CONFIG_TFTP_TSIZE=y, the progress bar is limited to 50 '#' characters. Otherwise an '#' is written per UDP package which may decrease performance. - -Return value ------------- - -The return value $? is 0 (true) on success and 1 (false) otherwise.
doc/usage/cmd/unbind.rst +0 -5
@@ -91,8 +91,3 @@ Configuration ------------- The unbind command is only available if CONFIG_CMD_BIND=y. - -Return code ------------ - -The return code $? is 0 (true) on success and 1 (false) on failure.
doc/usage/cmd/wdt.rst +0 -5
@@ -73,8 +73,3 @@ Configuration ------------- The command is only available if CONFIG_CMD_WDT=y. - -Return value ------------- - -The return value $? is 0 if the command succeeds, 1 upon failure.
doc/usage/cmd/wget.rst +0 -5
@@ -184,8 +184,3 @@ CONFIG_WGET_CACERT=y (for the wget cacert command). TCP Selective Acknowledgments in the legacy network stack can be enabled via CONFIG_PROT_TCP_SACK=y. This will improve the download speed. Selective Acknowledgments are enabled by default with lwIP. - -Return value ------------- - -The return value $? is 0 (true) on success and 1 (false) otherwise.
doc/usage/cmdline.rst +6 -0
@@ -55,6 +55,12 @@ General rules command will cause "run" to terminate, i. e. the remaining variables are not executed. +#. The variable `?` will be set as the return value of any command. The + possible values are 0 on success or 1 on any error e. g. invalid syntax or + failure of the command. Any exceptions to this are documented by the + specific command, e. g. :doc:`cmd/for` sets this based on the last command + run within the loop. + Representing numbers --------------------
Signature · 1 line
2.43.0
Re: [PATCH v2 1/3] doc: usage: Add general rule for `$?`
Hi Tom,
Quoted 9 lines · Tom Rini
For nearly all commands in U-Boot the '?' variable is handled the same way with 0 meaning success, 1 meaning any failure. Explain this in the general rules section of the cmdline documentation (with a link to a counter example) and then remove the redundant wording from most commands. We retain a section about the return value in a number of places where we are doing something such as always returning a specific value or we have useful additional information to go along with the normal return codes.
Quoted 5 lines
Signed-off-by Tom Rini <[email protected]>---
Changes in v2:
- Rewordings suggested by Quentin
- After confirming that invalid syntax also always returns 1 and not -1,
For example cmd/scmi.c do_scmi_set_proto() can return CMD_RET_USAGE which is a -1 enum and the function returns an int, so I assume this would be propagated properly?
I don't have time today to check the cmd function call stack to see if it is, but this seems odd to me.
Cheers,
Quentin
Re: [PATCH v2 1/3] doc: usage: Add general rule for `$?`
Quoted 18 lines · Quentin Schulz
Hi Tom,
Quoted 9 lines · Tom Rini
For nearly all commands in U-Boot the '?' variable is handled the same way with 0 meaning success, 1 meaning any failure. Explain this in the general rules section of the cmdline documentation (with a link to a counter example) and then remove the redundant wording from most commands. We retain a section about the return value in a number of places where we are doing something such as always returning a specific value or we have useful additional information to go along with the normal return codes.
Quoted 5 lines
Signed-off-by Tom Rini <[email protected]>---
Changes in v2:
- Rewordings suggested by Quentin
- After confirming that invalid syntax also always returns 1 and not -1,
Quoted 6 lines
For example
cmd/scmi.cdo_scmi_set_proto()can returnCMD_RET_USAGEwhich is a -1 enum and the function returns an int, so I assume this would be propagated properly?I don't have time today to check the cmd function call stack to see if it is, but this seems odd to me.
I spent a while Tuesday trying to dig in to this. We always pass CMD_RET_USAGE internally, CMD_RET_USAGE is -1. I ended up getting stuck on where we actually set the '?' environment variable. I don't know if we have ever actually passed -1 to the shell. Testing things out in a real shell, "2" is the value of invalid invalid syntax for a command (e.g. /bin/bash --keyboardsmash;echo $?).
Signature · 1 line
Tom
Re: [PATCH v2 1/3] doc: usage: Add general rule for `$?`
Hi Tom,
Quoted 26 lines · Tom Rini
Quoted 18 lines · Quentin Schulz
Hi Tom,
Quoted 9 lines · Tom Rini
For nearly all commands in U-Boot the '?' variable is handled the same way with 0 meaning success, 1 meaning any failure. Explain this in the general rules section of the cmdline documentation (with a link to a counter example) and then remove the redundant wording from most commands. We retain a section about the return value in a number of places where we are doing something such as always returning a specific value or we have useful additional information to go along with the normal return codes.
Quoted 5 lines
Signed-off-by Tom Rini <[email protected]>---
Changes in v2:
- Rewordings suggested by Quentin
- After confirming that invalid syntax also always returns 1 and not -1,Quoted 6 lines
For example
cmd/scmi.cdo_scmi_set_proto()can returnCMD_RET_USAGEwhich is a -1 enum and the function returns an int, so I assume this would be propagated properly?I don't have time today to check the cmd function call stack to see if it is, but this seems odd to me.
Quoted 7 lines
I spent a while Tuesday trying to dig in to this. We always pass
CMD_RET_USAGEinternally,CMD_RET_USAGEis -1. I ended up getting stuck on where we actually set the '?' environment variable. I don't know if we have ever actually passed -1 to the shell. Testing things out in a real shell, "2" is the value of invalid invalid syntax for a command (e.g./bin/bash--keyboardsmash;echo $?).
Curiosity got the better of me and I believe we probably set it from
get_dollar_var() in common/cli_hush.c where we do
sprintf(buf, "%u", (unsigned int)last_return_code);
which anyway is an unsigned int.
More things to add to the todo list for next week :)
But I did verify with askenv and indeed the shell reports 1 in $? while the enum value is -1.
Cheers,
Quentin
PATCH v2 2/3 doc: askenv: Reword and remove return value
In reply to Tom RiniWith the addition of general text about how the return value is handled, remove the examples from the askenv documentation as they are all normal expected results.
---
Cc: Heinrich Schuchardt <[email protected]>
Cc: Quentin Schulz <[email protected]>
--- doc/usage/cmd/askenv.rst | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-)
doc/usage/cmd/askenv.rst +3 -24
@@ -42,9 +42,8 @@ Value of a environment variable env1 without message and size parameters: :: - => askenv env1;echo $? + => askenv env1 Please enter 'env1': val1 - 0 => printenv env1 env1=val1
@@ -52,9 +51,8 @@ Value of a environment variable env2 with message and size parameters: :: - => askenv env2 Please type-in a value for env2: 10;echo $? + => askenv env2 Please type-in a value for env2: 10 Please type-in a value for env2: 1234567890123 - 0 => printenv env2 env2=1234567890
@@ -62,31 +60,12 @@ Value of a environment variable env3 with size parameter only: :: - => askenv env3 10;echo $? + => askenv env3 10 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).
Signature · 1 line
2.43.0
Re: [PATCH v2 2/3] doc: askenv: Reword and remove return value
Hi Tom,
Quoted 5 lines · Tom Rini
With the addition of general text about how the return value is handled, remove the examples from the askenv documentation as they are all normal expected results.
Signed-off-by Tom Rini <[email protected]>
Thanks!
Quentin
PATCH v2 3/3 doc: seama: Reword return value section
In reply to Tom RiniWith the addition of general text about how the return value is handled, reference that while retaining the additional information about setting $seama_image_size
---
Cc: Heinrich Schuchardt <[email protected]>
--- doc/usage/cmd/seama.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
doc/usage/cmd/seama.rst +2 -5
@@ -56,8 +56,5 @@ The command is available if CONFIG_CMD_SEAMA=y. Return value ------------ -The return value $? is set 0 (true) if the loading is succefull, and -is set to 1 (false) in case of error. - -The environment variable $seama_image_size is set to the size of the -loaded SEAMA image. +Along with the general rules for setting $?, the environment variable +$seama_image_size is set to the size of the loaded SEAMA image.
Signature · 1 line
2.43.0
Re: [PATCH v2 3/3] doc: seama: Reword return value section
Hi Tom,
Quoted 17 lines · Tom Rini
With the addition of general text about how the return value is handled, reference that while retaining the additional information about setting $seama_image_size
Reviewed-by Quentin Schulz <[email protected]>Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>--- doc/usage/cmd/seama.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)doc/usage/cmd/seama.rst +0
-0
doc/usage/cmd/seama.rst The command is available if CONFIG_CMD_SEAMA=y. · line 60
Quoted 10 lines
doc/usage/cmd/seama.rst +2
-5@@ -56,8 +56,5 @@ The command is available if CONFIG_CMD_SEAMA=y. Return value ------------ -The return value $? is set 0 (true) if the loading is succefull, and -is set to 1 (false) in case of error. - -The environment variable $seama_image_size is set to the size of the -loaded SEAMA image. +Along with the general rules for setting $?, the environment variable +$seama_image_size is set to the size of the loaded SEAMA image.
Maybe we could link to the general rules section.
Adding a cross-reference label above the text added in patch 01 and then
:ref:the general rules for setting $? <the cross-reference link you'd add>
should do the trick (note that we need to use a text for the reference because the cross-reference in Sphinx cannot guess it for anything but a section title, c.f. https://www.sphinx-doc.org/en/master/usage/referencing.html#role-ref).
In any case,
Thanks!
Quentin
Re: [PATCH v2 3/3] doc: seama: Reword return value section
Quoted 32 lines · Quentin Schulz
Hi Tom,
Quoted 17 lines · Tom Rini
With the addition of general text about how the return value is handled, reference that while retaining the additional information about setting $seama_image_size
Reviewed-by Quentin Schulz <[email protected]>Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>--- doc/usage/cmd/seama.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)doc/usage/cmd/seama.rst +0
-0doc/usage/cmd/seama.rst The command is available if CONFIG_CMD_SEAMA=y. · line 59
Quoted 9 lines
doc/usage/cmd/seama.rst +2
-5@@ -56,8 +56,5 @@ The command is available if CONFIG_CMD_SEAMA=y. Return value ------------ -The return value $? is set 0 (true) if the loading is succefull, and -is set to 1 (false) in case of error. - -The environment variable $seama_image_size is set to the size of the -loaded SEAMA image. +Along with the general rules for setting $?, the environment variable +$seama_image_size is set to the size of the loaded SEAMA image.Maybe we could link to the general rules section.
Quoted 8 lines
Adding a cross-reference label above the text added in patch 01 and then
:ref:
the general rules for setting $? <the cross-reference link you'd add>should do the trick (note that we need to use a text for the reference because the cross-reference in Sphinx cannot guess it for anything but a section title, c.f.
https://www.sphinx-doc.org/en/master/usage/referencing.html#role-ref).
One of my goals is to reduce the work needed for every command doc that we add. I want to simplify doc/usage/index.rst as well (I think we can glob), and then maybe add a note to the start of that section? I'll play around...
Signature · 1 line
Tom