aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/shell/shell_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/various/shell/shell_cmd.c')
-rw-r--r--os/various/shell/shell_cmd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/os/various/shell/shell_cmd.c b/os/various/shell/shell_cmd.c
index 1a8bba4a4..7d592286b 100644
--- a/os/various/shell/shell_cmd.c
+++ b/os/various/shell/shell_cmd.c
@@ -93,6 +93,18 @@ static void cmd_info(BaseSequentialStream *chp, int argc, char *argv[]) {
}
#endif
+#if (SHELL_CMD_ECHO_ENABLED == TRUE) || defined(__DOXYGEN__)
+static void cmd_echo(BaseSequentialStream *chp, int argc, char *argv[]) {
+
+ (void)argv;
+ if (argc != 1) {
+ usage(chp, "echo \"message\"");
+ return;
+ }
+ chprintf(chp, "%s\r\n", argv[0]);
+}
+#endif
+
#if (SHELL_CMD_SYSTIME_ENABLED == TRUE) || defined(__DOXYGEN__)
static void cmd_systime(BaseSequentialStream *chp, int argc, char *argv[]) {
@@ -175,6 +187,9 @@ ShellCommand shell_local_commands[] = {
#if SHELL_CMD_INFO_ENABLED == TRUE
{"info", cmd_info},
#endif
+#if SHELL_CMD_ECHO_ENABLED == TRUE
+ {"echo", cmd_echo},
+#endif
#if SHELL_CMD_SYSTIME_ENABLED == TRUE
{"systime", cmd_systime},
#endif