]> git.proxmox.com Git - ovs.git/commitdiff
table: provide table formatting option help at runtime
authorLance Richardson <lrichard@redhat.com>
Fri, 31 Mar 2017 17:21:03 +0000 (13:21 -0400)
committerBen Pfaff <blp@ovn.org>
Thu, 6 Apr 2017 15:04:55 +0000 (08:04 -0700)
Show table formatting options with help output from
ovn-nbctl, obn-sbctl, ovs-vsctl, and vtep-ctl commands.
Include "--data" option in ovsdb-client help output.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/table.c
lib/table.h
ovn/utilities/ovn-nbctl.c
ovn/utilities/ovn-sbctl.c
ovsdb/ovsdb-client.c
utilities/ovs-vsctl.c
vtep/vtep-ctl.c

index 9158499bf7e17b06a2330b930549748cb43be7bf..6136beb2fabdefcdba33e46c85492fbce588ed6d 100644 (file)
@@ -594,3 +594,19 @@ table_print(const struct table *table, const struct table_style *style)
         break;
     }
 }
+
+void
+table_usage(void)
+{
+    printf("\nOutput formatting options:\n"
+           "  -f, --format=FORMAT         set output formatting to FORMAT\n"
+           "                              (\"table\", \"html\", \"csv\", "
+           "or \"json\")\n"
+           "  -d, --data=FORMAT           set table cell output formatting to\n"
+           "                              FORMAT (\"string\", \"bare\", "
+           "or \"json\")\n"
+           "  --no-headings               omit table heading row\n"
+           "  --pretty                    pretty-print JSON in output\n"
+           "  --bare                      equivalent to "
+           "\"--format=list --data=bare --no-headings\"\n");
+}
index 7330a33c15841b872a0d23c1795a4644f4c4be2f..fee36897f81f1764c87224983ed88feaedfc8f31 100644 (file)
@@ -121,5 +121,6 @@ void table_parse_format(struct table_style *, const char *format);
 void table_parse_cell_format(struct table_style *, const char *format);
 
 void table_print(const struct table *, const struct table_style *);
+void table_usage(void);
 
 #endif /* table.h */
index ebb9349dcea9037743ee952ae2efa1bed927ace1..598f502af5b4bb71c100292d9235af475d68cb11 100644 (file)
@@ -448,6 +448,7 @@ Options:\n\
   --oneline                   print exactly one line of output per command\n",
            program_name, program_name, ctl_get_db_cmd_usage(),
            default_nb_db());
+    table_usage();
     vlog_usage();
     printf("\
   --no-syslog             equivalent to --verbose=nbctl:syslog:warn\n");
index 4e3cbadac88c58d2a9ca6e2b4c8e730033b285a4..ffa931ae13e4f206dd1b542bf112bde39e1ca008 100644 (file)
@@ -327,6 +327,7 @@ Options:\n\
   --oneline                   print exactly one line of output per command\n",
            program_name, program_name, ctl_get_db_cmd_usage(),
            default_sb_db());
+    table_usage();
     vlog_usage();
     printf("\
   --no-syslog             equivalent to --verbose=sbctl:syslog:warn\n");
index ba232fce1301c3f5373b93fe05420ff92ba81507..1df4fb4da92c791f3308cbb8fd2d6009aad1120a 100644 (file)
@@ -282,13 +282,8 @@ usage(void)
            "The default DATABASE is Open_vSwitch.\n",
            program_name, program_name, ovs_rundir());
     stream_usage("SERVER", true, true, true);
-    printf("\nOutput formatting options:\n"
-           "  -f, --format=FORMAT         set output formatting to FORMAT\n"
-           "                              (\"table\", \"html\", \"csv\", "
-           "or \"json\")\n"
-           "  --no-headings               omit table heading row\n"
-           "  --pretty                    pretty-print JSON in output\n"
-           "  --timestamp                 timestamp \"monitor\" output");
+    table_usage();
+    printf("  --timestamp                 timestamp \"monitor\" output");
     daemon_usage();
     vlog_usage();
     printf("\nOther options:\n"
index 4d9845e6a4f7043243c953568f26e37e642ac22c..84176dea99d3cf0dab1e9348a01f04704dd1fa27 100644 (file)
@@ -421,6 +421,7 @@ Options:\n\
   --dry-run                   do not commit changes to database\n\
   --oneline                   print exactly one line of output per command\n",
            program_name, program_name, ctl_get_db_cmd_usage(), ctl_default_db());
+    table_usage();
     vlog_usage();
     printf("\
   --no-syslog             equivalent to --verbose=vsctl:syslog:warn\n");
index e23c987da483aa54f28c678ef30c3aa567d83bb6..7dc3cc7759b2eed9609f423ca31da83c5f12657d 100644 (file)
@@ -366,6 +366,7 @@ Options:\n\
   --dry-run                   do not commit changes to database\n\
   --oneline                   print exactly one line of output per command\n",
            program_name, program_name, ctl_get_db_cmd_usage(), ctl_default_db());
+    table_usage();
     vlog_usage();
     printf("\
   --no-syslog                 equivalent to --verbose=vtep_ctl:syslog:warn\n");