[cli] fix extra error output when handling user CLI commands (#6562)

It also adds a check in `cli-misc.exp` to verify error on an invalid
CLI command
This commit is contained in:
Abtin Keshavarzian
2021-05-04 15:17:41 -07:00
committed by GitHub
parent 864c4be9e5
commit 98e353ca69
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -4901,7 +4901,7 @@ void Interpreter::ProcessLine(char *aBuf)
ExitNow();
}
SuccessOrExit(ProcessUserCommands(argsLength, args));
VerifyOrExit(ProcessUserCommands(argsLength, args) != OT_ERROR_NONE);
OutputResult(OT_ERROR_INVALID_COMMAND);
exit:
+3
View File
@@ -173,4 +173,7 @@ expect "Done"
send "ba state\n"
expect "Done"
send "invalidcommand\n"
expect_line "Error 35: InvalidCommand"
dispose_all