shell: Remove unnecessary first_string variable

This variable adds no value, and is in fact longer to spell out than
simply argv[0].

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-15 08:32:41 +02:00 committed by Johan Hedberg
commit 39a733151d

View file

@ -306,20 +306,19 @@ static int exit_module(int argc, char *argv[])
static shell_cmd_function_t get_cb(int *argc, char *argv[], int *module) static shell_cmd_function_t get_cb(int *argc, char *argv[], int *module)
{ {
const char *first_string = argv[0];
const struct shell_module *shell_module; const struct shell_module *shell_module;
const char *command; const char *command;
int i; int i;
if (!strcmp(first_string, "help")) { if (!strcmp(argv[0], "help")) {
return show_help; return show_help;
} }
if (!strcmp(first_string, "select")) { if (!strcmp(argv[0], "select")) {
return select_module; return select_module;
} }
if (!strcmp(first_string, "exit")) { if (!strcmp(argv[0], "exit")) {
return exit_module; return exit_module;
} }