mirror of
https://github.com/espressif/openthread.git
synced 2026-10-01 21:37:39 +00:00
Prompt Error for unsupported cli commands (#1154)
This commit is contained in:
+8
-2
@@ -2583,8 +2583,8 @@ void Interpreter::ProcessDiag(int argc, char *argv[])
|
|||||||
void Interpreter::ProcessLine(char *aBuf, uint16_t aBufLength, Server &aServer)
|
void Interpreter::ProcessLine(char *aBuf, uint16_t aBufLength, Server &aServer)
|
||||||
{
|
{
|
||||||
char *argv[kMaxArgs];
|
char *argv[kMaxArgs];
|
||||||
int argc = 0;
|
|
||||||
char *cmd;
|
char *cmd;
|
||||||
|
uint8_t argc = 0, i = 0;
|
||||||
|
|
||||||
sServer = &aServer;
|
sServer = &aServer;
|
||||||
|
|
||||||
@@ -2615,7 +2615,7 @@ void Interpreter::ProcessLine(char *aBuf, uint16_t aBufLength, Server &aServer)
|
|||||||
sServer->OutputFormat("under diagnostics mode, execute 'diag stop' before running any other commands.\r\n"));
|
sServer->OutputFormat("under diagnostics mode, execute 'diag stop' before running any other commands.\r\n"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (unsigned int i = 0; i < sizeof(sCommands) / sizeof(sCommands[0]); i++)
|
for (i = 0; i < sizeof(sCommands) / sizeof(sCommands[0]); i++)
|
||||||
{
|
{
|
||||||
if (strcmp(cmd, sCommands[i].mName) == 0)
|
if (strcmp(cmd, sCommands[i].mName) == 0)
|
||||||
{
|
{
|
||||||
@@ -2624,6 +2624,12 @@ void Interpreter::ProcessLine(char *aBuf, uint16_t aBufLength, Server &aServer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Error prompt for unsupported commands
|
||||||
|
if (i == sizeof(sCommands) / sizeof(sCommands[0]))
|
||||||
|
{
|
||||||
|
AppendResult(kThreadError_Parse);
|
||||||
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user