u-boot/doc/usage
Marek Vasut 721307eba0 cmd: exit: Fix return value propagation out of environment scripts
Make sure the 'exit' command as well as 'exit $val' command exits
from environment scripts immediately and propagates return value
out of those scripts fully. That means the following behavior is
expected:

"
=> setenv foo 'echo bar ; exit 1' ; run foo ; echo $?
bar
1
=> setenv foo 'echo bar ; exit 0' ; run foo ; echo $?
bar
0
=> setenv foo 'echo bar ; exit -2' ; run foo ; echo $?
bar
0
"

As well as the followin behavior:

"
=> setenv foo 'echo bar ; exit 3 ; echo fail'; run foo; echo $?
bar
3
=> setenv foo 'echo bar ; exit 1 ; echo fail'; run foo; echo $?
bar
1
=> setenv foo 'echo bar ; exit 0 ; echo fail'; run foo; echo $?
bar
0
=> setenv foo 'echo bar ; exit -1 ; echo fail'; run foo; echo $?
bar
0
=> setenv foo 'echo bar ; exit -2 ; echo fail'; run foo; echo $?
bar
0
=> setenv foo 'echo bar ; exit ; echo fail'; run foo; echo $?
bar
0
"

Fixes: 8c4e3b79bd ("cmd: exit: Fix return value")
Reviewed-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Marek Vasut <marex@denx.de>
2023-01-11 15:02:24 -05:00
..
cmd cmd: exit: Fix return value propagation out of environment scripts 2023-01-11 15:02:24 -05:00
os doc: usage: Convert README.plan9 to reST 2022-03-31 19:06:16 +02:00
cmdline.rst doc: man-page for the env command 2022-04-15 11:23:02 +02:00
dfu.rst doc: usage: DFU: Fix dfu_alt_info document 2022-02-11 11:29:23 -05:00
environment.rst global: Migrate CONFIG_EXTRA_ENV_SETTINGS to CFG 2022-12-23 10:09:42 -05:00
fdt_overlays.rst doc: usage: Fix command in fdt overlay apply sequence 2021-12-09 11:43:25 -08:00
fit.rst binman: doc: Add documentation to htmldocs 2021-03-26 17:03:10 +13:00
index.rst doc: man-page for the sound command 2022-12-05 17:43:21 +01:00
netconsole.rst doc: move README.NetConsole to HTML documentation 2020-12-15 09:37:00 +01:00
partitions.rst blk: Rename if_type to uclass_id 2022-09-25 08:30:05 -06:00
semihosting.rst ls1046ardb: Add support for JTAG boot 2022-04-01 16:56:44 -04:00