From b83e4224e006fccb20e624a5f6e5170b19e6ea1d Mon Sep 17 00:00:00 2001 From: Jakub Rzeszutko Date: Thu, 30 Jul 2020 11:50:32 +0200 Subject: [PATCH] shell: correct build-in commands definition The definition of the help command has been changed so that it does not accept the arguments. Thanks to this it cannot be marked by the "select" command. Signed-off-by: Jakub Rzeszutko --- subsys/shell/shell_cmds.c | 3 +-- tests/shell/src/main.c | 4 ++-- tests/subsys/fs/multi-fs/src/test_fs_shell.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/subsys/shell/shell_cmds.c b/subsys/shell/shell_cmds.c index 03b324b91d7..3e72ab2d472 100644 --- a/subsys/shell/shell_cmds.c +++ b/subsys/shell/shell_cmds.c @@ -458,8 +458,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(m_sub_resize, SHELL_CMD_ARG_REGISTER(clear, NULL, SHELL_HELP_CLEAR, cmd_clear, 1, 0); SHELL_CMD_REGISTER(shell, &m_sub_shell, SHELL_HELP_SHELL, NULL); -SHELL_CMD_ARG_REGISTER(help, NULL, SHELL_HELP_HELP, cmd_help, - 1, SHELL_OPT_ARG_CHECK_SKIP); +SHELL_CMD_ARG_REGISTER(help, NULL, SHELL_HELP_HELP, cmd_help, 1, 0); SHELL_COND_CMD_ARG_REGISTER(CONFIG_SHELL_HISTORY, history, NULL, SHELL_HELP_HISTORY, cmd_history, 1, 0); SHELL_COND_CMD_ARG_REGISTER(CONFIG_SHELL_CMDS_RESIZE, resize, &m_sub_resize, diff --git a/tests/shell/src/main.c b/tests/shell/src/main.c index f677c065c74..06735b8a0da 100644 --- a/tests/shell/src/main.c +++ b/tests/shell/src/main.c @@ -38,8 +38,8 @@ static void test_cmd_help(void) test_shell_execute_cmd("help", 0); test_shell_execute_cmd("help -h", 1); test_shell_execute_cmd("help --help", 1); - test_shell_execute_cmd("help dummy", 0); - test_shell_execute_cmd("help dummy dummy", 0); + test_shell_execute_cmd("help dummy", -EINVAL); + test_shell_execute_cmd("help dummy dummy", -EINVAL); } static void test_cmd_clear(void) diff --git a/tests/subsys/fs/multi-fs/src/test_fs_shell.c b/tests/subsys/fs/multi-fs/src/test_fs_shell.c index 3d2461a27fd..4ea08b05371 100644 --- a/tests/subsys/fs/multi-fs/src/test_fs_shell.c +++ b/tests/subsys/fs/multi-fs/src/test_fs_shell.c @@ -30,7 +30,7 @@ void test_fs_help(void) { #ifdef CONFIG_FILE_SYSTEM_SHELL test_shell_exec("help", 0); - test_shell_exec("help fs", 0); + test_shell_exec("help fs", -EINVAL); test_shell_exec("fs mount fat", -EINVAL); test_shell_exec("fs mount littlefs", -EINVAL); #else