shell: enhance help command
To get a list of all supported shell commands user must hit the TAB button. It may be awkward on some terminal emulators. This change enhances the help command in a way it will in addition print all supported commands. Fixes: #28785 Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
This commit is contained in:
parent
137b7ec5bd
commit
f43985e334
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
#include <shell/shell.h>
|
||||
#include "shell_utils.h"
|
||||
#include "shell_help.h"
|
||||
#include "shell_ops.h"
|
||||
#include "shell_vt100.h"
|
||||
|
||||
|
@ -290,12 +291,15 @@ static int cmd_help(const struct shell *shell, size_t argc, char **argv)
|
|||
" for more information.");
|
||||
#if defined(CONFIG_SHELL_METAKEYS)
|
||||
shell_print(shell,
|
||||
"Shell supports following meta-keys:\n"
|
||||
"\nShell supports following meta-keys:\n"
|
||||
"Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e, Ctrl+f, Ctrl+k,"
|
||||
" Ctrl+l, Ctrl+n, Ctrl+p, Ctrl+u, Ctrl+w\nAlt+b, Alt+f.\n"
|
||||
"Please refer to shell documentation for more details.");
|
||||
#endif
|
||||
|
||||
/* For NULL argument function will print all root commands */
|
||||
shell_help_subcmd_print(shell, NULL, "\nAvailable commands:\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue