[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
+1
View File
@@ -58,6 +58,7 @@ proc wait_for {command success {failure {[\r\n]FAILURE_NOT_EXPECTED[\r\n]}}} {
}
proc expect_line {line} {
set timeout 10
expect -re "\[\r\n \]($line)(?=\[\r\n>\])"
return $expect_out(1,string)
}