Avoid error message appearing incorrectly after showing cli commands.

This commit is contained in:
Dominic Clifton 2014-08-02 10:05:38 +01:00
parent 7e5eeb53b2
commit 81cf29be70
1 changed files with 8 additions and 1 deletions

View File

@ -973,6 +973,7 @@ static void cliGet(char *cmdline)
{
uint32_t i;
const clivalue_t *val;
int matchedCommands = 0;
for (i = 0; i < VALUE_COUNT; i++) {
if (strstr(valueTable[i].name, cmdline)) {
@ -980,10 +981,16 @@ static void cliGet(char *cmdline)
printf("%s = ", valueTable[i].name);
cliPrintVar(val, 0);
printf("\r\n");
matchedCommands++;
}
}
// If we get down here, then the variable was not found
if (matchedCommands) {
return;
}
cliPrint("ERR: Unknown variable name\r\n");
}