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:
parent
76fb522993
commit
39a733151d
1 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
const char *first_string = argv[0];
|
||||
const struct shell_module *shell_module;
|
||||
const char *command;
|
||||
int i;
|
||||
|
||||
if (!strcmp(first_string, "help")) {
|
||||
if (!strcmp(argv[0], "help")) {
|
||||
return show_help;
|
||||
}
|
||||
|
||||
if (!strcmp(first_string, "select")) {
|
||||
if (!strcmp(argv[0], "select")) {
|
||||
return select_module;
|
||||
}
|
||||
|
||||
if (!strcmp(first_string, "exit")) {
|
||||
if (!strcmp(argv[0], "exit")) {
|
||||
return exit_module;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue