From 05f7ca110bb67f73af69ded6b915ee70754fbb6f Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Mon, 21 Jan 2019 16:28:48 +0100 Subject: [PATCH] make the output of "show api dump file compare-current" doxygen-friendly The current output of the API diff requires some massaging to appear like a table in the docs generated by doxygen. This change eliminates this need. Change-Id: Ic9269a0e5e232e4d01a0695561e4f90eee287327 Signed-off-by: Andrew Yourtchenko --- src/vlibmemory/vlib_api_cli.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c index 2d8d4077871..4a86b8d76bb 100755 --- a/src/vlibmemory/vlib_api_cli.c +++ b/src/vlibmemory/vlib_api_cli.c @@ -1082,6 +1082,7 @@ dump_api_table_file_command_fn (vlib_main_t * vm, if (compare_current) { + u8 *dashes = 0; ndifferences = 0; /* @@ -1090,8 +1091,11 @@ dump_api_table_file_command_fn (vlib_main_t * vm, * are identical. Otherwise, the crc is different, or a message is * present in only one of the tables. */ - vlib_cli_output (vm, "%=60s %s", "Message Name", "Result"); - + vlib_cli_output (vm, "%-60s | %s", "Message Name", "Result"); + vec_validate_init_empty (dashes, 60, '-'); + vec_terminate_c_string (dashes); + vlib_cli_output (vm, "%60s-|-%s", dashes, "-----------------"); + vec_free (dashes); for (i = 0; i < vec_len (table);) { /* Last message lonely? */ @@ -1118,20 +1122,20 @@ dump_api_table_file_command_fn (vlib_main_t * vm, || strcmp ((char *) table[i].name, (char *) table[i + 1].name)) { last_unique: - vlib_cli_output (vm, "%-60s only in %s", + vlib_cli_output (vm, "%-60s | only in %s", table[i].name, table[i].which ? "image" : "file"); i++; continue; } /* In both tables, but with different signatures */ - vlib_cli_output (vm, "%-60s definition changed", table[i].name); + vlib_cli_output (vm, "%-60s | definition changed", table[i].name); i += 2; } if (ndifferences == 0) vlib_cli_output (vm, "No api message signature differences found."); else - vlib_cli_output (vm, "Found %u api message signature differences", + vlib_cli_output (vm, "\nFound %u api message signature differences", ndifferences); goto cleanup; } -- 2.16.6