From: Petr Hodina <[email protected]>

Add the monitor subcommand to the synopsis, description and return
value table of the button command page.

Signed-off-by: Petr Hodina <[email protected]>
---
 doc/usage/cmd/button.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/doc/usage/cmd/button.rst b/doc/usage/cmd/button.rst
index 6c6794f31b8..49bc373b5d3 100644
--- a/doc/usage/cmd/button.rst
+++ b/doc/usage/cmd/button.rst
@@ -12,6 +12,7 @@ Synopsis
 ::
 
     button list
+    button monitor [timeout_ms]
     button <name>
 
 Description
@@ -43,6 +44,19 @@ A list of all available buttons and their status can be 
displayed using
 If a button device has not been probed yet, its status will be shown as
 *<inactive>* in the list.
 
+To watch the buttons live, for example to verify wiring on a device, use
+
+::
+
+    button monitor [timeout_ms]
+
+This probes all buttons, clears the screen and shows a table of their status
+in the same format as *button list* (*on*, *off*, *<inactive>* if probing 
failed,
+or an error code), refreshed every 100ms together with the remaining time. The
+command exits when *timeout_ms* milliseconds have elapsed or when Ctrl-C is
+pressed. The default is 5000ms. A *timeout_ms* of 0 means to run until Ctrl-C
+is pressed.
+
 Configuration
 -------------
 
@@ -61,6 +75,8 @@ The variable *$?* takes the following values
 +---+-----------------------------+
 | 0 | button list was shown       |
 +---+-----------------------------+
+| 0 | button monitor ended        |
++---+-----------------------------+
 | 1 | button not found            |
 +---+-----------------------------+
 | 1 | invalid arguments           |

-- 
2.55.0


Reply via email to