Skip to content

Commit

Permalink
Merge pull request #18075 from kaspar030/drop_shell_buildin_commands_…
Browse files Browse the repository at this point in the history
…define

sys/shell: drop `_builtin_cmds` define
  • Loading branch information
benpicco authored May 10, 2022
2 parents 7e13424 + b8fef54 commit 3771c06
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions sys/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ XFA_INIT_CONST(shell_command_t*, shell_commands_xfa);
#define flush_if_needed()
#endif /* MODULE_NEWLIB || MODULE_PICOLIBC */

#ifdef MODULE_SHELL_COMMANDS
#define _builtin_cmds _shell_command_list
#else
#define _builtin_cmds NULL
#endif

#define SQUOTE '\''
#define DQUOTE '"'
#define ESCAPECHAR '\\'
Expand Down Expand Up @@ -117,8 +111,8 @@ static shell_command_handler_t find_handler(
handler = search_commands(command_list, command);
}

if (handler == NULL && _builtin_cmds != NULL) {
handler = search_commands(_builtin_cmds, command);
if (IS_USED(MODULE_SHELL_COMMANDS) && handler == NULL) {
handler = search_commands(_shell_command_list, command);
}

if (handler == NULL) {
Expand Down Expand Up @@ -152,8 +146,8 @@ static void print_help(const shell_command_t *command_list)
print_commands(command_list);
}

if (_builtin_cmds != NULL) {
print_commands(_builtin_cmds);
if (IS_USED(MODULE_SHELL_COMMANDS)) {
print_commands(_shell_command_list);
}

print_commands_xfa();
Expand Down

0 comments on commit 3771c06

Please sign in to comment.