shell: make detecting help option optional

Shell will not "steal" by default "-h" and "--help" each time
help functions are enabled.
This change is necessary to implement and use the getopt library.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2021-01-14 12:31:07 +01:00 committed by Anas Nashif
commit b64fb7c92d
4 changed files with 28 additions and 3 deletions

View file

@ -121,7 +121,17 @@ config SHELL_HELP
bool "Enable help message"
default y if !SHELL_MINIMAL
help
Enables formatting help message when requested with '-h' or '--help'.
Enables shell functions for printing formatted help message.
config SHELL_HELP_OPT_PARSE
bool "Parse -h and --help options"
depends on SHELL_HELP
depends on !SHELL_GETOPT
default y
help
Shell parses command to find '-h' or '--help' string. If the shell
finds the string, it will automatically print a help message
for a command.
config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT
bool "Enable printing help on wrong argument count"