[cli] add helper Interpreter::OutputTableHeader() (#6696)

This commit adds a helper method `OutputTableHeader()` that can be
used to print a table header from a given array of column widths and
title strings. This is then used in CLI module for different tables
(child/neighbor/router table, active/energy scan result, etc).
This commit is contained in:
Abtin Keshavarzian
2021-06-02 15:22:45 -07:00
committed by GitHub
parent 5ae8cf527c
commit d16edaa5ef
4 changed files with 105 additions and 20 deletions
+3 -3
View File
@@ -35,14 +35,14 @@ setup_leader
send "udp open\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect "| [0:0:0:0:0:0:0:0]:0 | [0:0:0:0:0:0:0:0]:0 |"
expect_line "Done"
send "udp bind :: 10001\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect "| [0:0:0:0:0:0:0:0]:1001 | [0:0:0:0:0:0:0:0]:0 |"
expect_line "Done"
@@ -50,7 +50,7 @@ set addr [get_ipaddr mleid]
send "udp connect $addr 10001\n"
expect_line "Done"
send "netstat\n"
expect "| Local Address | Peer Address |"
expect "| Local Address | Peer Address |"
expect "+-------------------------------------------------+-------------------------------------------------+"
expect -re "\\| \\[0:0:0:0:0:0:0:0\\]:10001 +\\| \\[$addr\\]:10001 +\\|"
expect_line "Done"