Skip to content

Commit 1b042f8

Browse files
committed
shell: Add shell command command rem (#151)
Added the shell comment command Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
1 parent 5a573e4 commit 1b042f8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ subsys/net/lib/ping/Kconfig merge=ours
209209
subsys/net/lib/ping/ping.c merge=ours
210210
subsys/shell/modules/date_service.c merge=ours
211211
subsys/shell/shell_help.c merge=ours
212+
subsys/shell/shell_cmds.c merge=ours
212213
subsys/shell/shell_ops.c merge=ours
213214
tests/drivers/counter/counter_basic_api/boards/efm32pg_stk3402a.conf merge=ours
214215
tests/drivers/counter/counter_basic_api/boards/tmo_dev_edge.conf merge=ours

subsys/shell/shell_cmds.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "shell_vt100.h"
1111

1212
#define SHELL_MSG_CMD_NOT_SUPPORTED "Command not supported.\n"
13+
#define SHELL_HELP_COMMENT "Ignore lines beginning with 'rem '"
1314
#define SHELL_HELP_CLEAR "Clear screen."
1415
#define SHELL_HELP_BACKENDS "List active shell backends.\n"
1516
#define SHELL_HELP_BACKSPACE_MODE "Toggle backspace key mode.\n" \
@@ -196,6 +197,15 @@ static int terminal_size_get(const struct shell *shell)
196197
return ret_val;
197198
}
198199

200+
static int cmd_comment(const struct shell *sh, size_t argc, char **argv)
201+
{
202+
ARG_UNUSED(sh);
203+
ARG_UNUSED(argc);
204+
ARG_UNUSED(argv);
205+
206+
return 0;
207+
}
208+
199209
static int cmd_clear(const struct shell *shell, size_t argc, char **argv)
200210
{
201211
ARG_UNUSED(argv);
@@ -488,6 +498,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(m_sub_resize,
488498
SHELL_SUBCMD_SET_END
489499
);
490500

501+
SHELL_COND_CMD_REGISTER(CONFIG_SHELL_VT100_COMMANDS, rem, NULL,
502+
SHELL_HELP_COMMENT, cmd_comment);
491503
SHELL_COND_CMD_ARG_REGISTER(CONFIG_SHELL_VT100_COMMANDS, clear, NULL,
492504
SHELL_HELP_CLEAR, cmd_clear, 1, 0);
493505
SHELL_CMD_REGISTER(shell, &m_sub_shell, SHELL_HELP_SHELL, NULL);

0 commit comments

Comments
 (0)