subsys: shell: Print help message only if command doesn't available

Fixes: #11250

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
This commit is contained in:
qianfan Zhao 2018-11-11 20:14:04 +08:00 committed by Anas Nashif
commit e3506832a4

View file

@ -956,9 +956,10 @@ static int exec_cmd(const struct shell *shell, size_t argc, char **argv)
} else {
shell_fprintf(shell, SHELL_ERROR,
SHELL_MSG_SPECIFY_SUBCOMMAND);
ret_val = -ENOEXEC;
goto clear;
}
ret_val = -ENOEXEC;
goto clear;
}
if (shell->ctx->active_cmd.args) {