make the output of "show api dump file <filename> 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 <ayourtch@gmail.com>
This commit is contained in:
Andrew Yourtchenko
2019-01-21 16:28:48 +01:00
committed by Dave Wallace
parent c213089c2d
commit 05f7ca110b

View File

@ -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;
}