cmd: Add pause command

This command is being introduced with the goal of allowing user-friendly
"generic use case" U-Boot builds to pause until user input under some
situations.

The main use case would be when a boot failure happens, to pause until
the user has had time to acknowledge the current state.

Tested using:

    make && ./u-boot -v -T -c 'ut lib lib_test_hush_pause'

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Cc: Simon Glass <sjg@chromium.org>
This commit is contained in:
Samuel Dionne-Riel
2022-08-18 15:44:04 -04:00
committed by Tom Rini
parent d88260710b
commit dc0d17c26a
9 changed files with 143 additions and 0 deletions

53
doc/usage/cmd/pause.rst Normal file
View File

@@ -0,0 +1,53 @@
.. SPDX-License-Identifier: GPL-2.0-or-later:
pause command
=============
Synopsis
--------
::
pause [prompt]
Description
-----------
The pause command delays execution waiting for any user input.
It can accept a single parameter to change the prompt message.
Examples
--------
Using with the default prompt:
::
=> pause
Press any key to continue...
Using with a custom prompt:
::
=> pause 'Prompt for pause...'
Prompt for pause...
Note that complex prompts require proper quoting:
::
=> pause Prompt for pause...
pause - delay until user input
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.

View File

@@ -52,6 +52,7 @@ Shell commands
cmd/mbr
cmd/md
cmd/mmc
cmd/pause
cmd/pinmux
cmd/printenv
cmd/pstore