[cli] make command output consistent (#6592)

This commit makes the CLI command output consistent under all cases:

- Output Error 6: Parse when the command line is too long (no output
  originally).

- Output Error 7: InvalidArgs when the command line has too many
  arguments. The original output is Error: too many args (max %d),
  which does not strictly follow the Error <code>: <msg> pattern.

- Output Error 13: InvalidState for running non-diag command in
  diagnosis mode to follow Error <code>: <msg> pattern.
This commit is contained in:
Simon Lin
2021-05-12 18:50:03 -07:00
committed by GitHub
parent 7fc5525928
commit 9347b290e1
2 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ class TestDiag(thread_cert.TestCase):
('diag', 'diagnostics mode is disabled\r\n'),
(
'diag 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32',
r'Error: too many args \(max 32\)\r\n',
r'Error 7: InvalidArgs\r\n',
),
]