diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index f4497417f..256bb6ac7 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -1644,7 +1644,7 @@ static void cliVersion(char *cmdline) { UNUSED(cmdline); - printf("Cleanflight/%s %s %s / %s (%s)", + printf("# Cleanflight/%s %s %s / %s (%s)", targetName, FC_VERSION_STRING, buildDate, @@ -1710,6 +1710,13 @@ void cliProcess(void) clicmd_t target; cliPrint("\r\n"); + // Strip comment starting with # from line + char *p = cliBuffer; + p = strchr(++p, '#'); + if (NULL != p) { + bufferIndex = (uint32_t)(p - cliBuffer); + } + // Strip trailing whitespace while (bufferIndex > 0 && cliBuffer[bufferIndex - 1] == ' ') { bufferIndex--;