make the output of "show api dump file <filename> compare-current" doxygen-friendly 37/16937/6
authorAndrew Yourtchenko <ayourtch@gmail.com>
Mon, 21 Jan 2019 15:28:48 +0000 (16:28 +0100)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 5 Apr 2019 22:50:54 +0000 (22:50 +0000)
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>
src/vlibmemory/vlib_api_cli.c

index 2d8d407..4a86b8d 100755 (executable)
@@ -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;
     }