[cli] disallow concurrent commands (#6695)

This commit disallows concurrent commands.

With this commit, the CLI only execute a new command after it complete
the previous command. CLI can also prompt properly after the command
execution is done.

Other fixes and enhancements:
- Fixes premature command prompt
- Add ping async command for ping in async mode: output Done
  immediately but print ping responses later on.
- Fixes networkdiagnostic get outputs multiple Done by always waiting
  for 5 seconds.
This commit is contained in:
Simon Lin
2021-09-09 20:46:43 -07:00
committed by GitHub
parent 9e631d816e
commit db2e313ef0
9 changed files with 108 additions and 48 deletions
+2
View File
@@ -180,6 +180,8 @@ class OtCliCommandRunner(OTCommandHandler):
def __otcli_read_routine(self):
while not self.__should_close.isSet():
line = self.__otcli.readline()
logging.debug('%s: %r', self.__otcli, line)
if line.startswith('> '):
line = line[2:]