shell: remove "options" concept

Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2018-11-26 15:56:24 +01:00 committed by Carles Cufí
commit 5451ff2848
29 changed files with 168 additions and 254 deletions

View file

@ -214,7 +214,7 @@ static int log_enable(const struct shell *shell,
char **argv)
{
int severity_level;
int err = shell_cmd_precheck(shell, (argc > 1), NULL, 0);
int err = shell_cmd_precheck(shell, (argc > 1));
if (err) {
return err;
@ -254,7 +254,7 @@ static int log_disable(const struct shell *shell,
size_t argc,
char **argv)
{
int err = shell_cmd_precheck(shell, (argc > 1), NULL, 0);
int err = shell_cmd_precheck(shell, (argc > 1));
if (err) {
return err;
@ -361,7 +361,7 @@ static int cmd_log_backends_list(const struct shell *shell,
size_t argc, char **argv)
{
int backend_count;
int err = shell_cmd_precheck(shell, (argc == 1), NULL, 0);
int err = shell_cmd_precheck(shell, (argc == 1));
if (err) {
return err;
@ -442,7 +442,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(sub_log_stat)
static int cmd_log(const struct shell *shell, size_t argc, char **argv)
{
if ((argc == 1) || shell_help_requested(shell)) {
shell_help_print(shell, NULL, 0);
shell_help_print(shell);
return 0;
}