Message ID | 1482435950-19239-1-git-send-email-lrichard@redhat.com |
---|---|
State | Accepted |
Headers | show |
On Thu, Dec 22, 2016 at 02:45:50PM -0500, Lance Richardson wrote: > There are currently five users of the table formatting library, > all of which default to "list" except for ovsdb-client which > defaults to "table". The library current default is "table", > and the table.man man page fragment only considers ovs-vsctl > to use something other than "table" as a default.As a result, > the man pages for ovn-sbctl and vtep-ctl are currently incorrect > (these options aren't documented in the ovn-nbctl man page, which > will need to be addressed in a future patch). > > Fix by making the library default format "list" and handling > ovsdb-client as the exception. > > Signed-off-by: Lance Richardson <lrichard@redhat.com> nroff. Ugh. Thank you! Acked-by: Ben Pfaff <blp@ovn.org>
On Thu, Dec 22, 2016 at 02:45:50PM -0500, Lance Richardson wrote: > There are currently five users of the table formatting library, > all of which default to "list" except for ovsdb-client which > defaults to "table". The library current default is "table", > and the table.man man page fragment only considers ovs-vsctl > to use something other than "table" as a default.As a result, > the man pages for ovn-sbctl and vtep-ctl are currently incorrect > (these options aren't documented in the ovn-nbctl man page, which > will need to be addressed in a future patch). > > Fix by making the library default format "list" and handling > ovsdb-client as the exception. > > Signed-off-by: Lance Richardson <lrichard@redhat.com> Applied to master, thanks!
diff --git a/lib/table.h b/lib/table.h index 85b8156..7330a33 100644 --- a/lib/table.h +++ b/lib/table.h @@ -80,7 +80,7 @@ struct table_style { int json_flags; /* CF_JSON: Flags for json_to_string(). */ }; -#define TABLE_STYLE_DEFAULT { TF_TABLE, CF_STRING, true, JSSF_SORT } +#define TABLE_STYLE_DEFAULT { TF_LIST, CF_STRING, true, JSSF_SORT } #define TABLE_OPTION_ENUMS \ OPT_NO_HEADINGS, \ diff --git a/lib/table.man b/lib/table.man index a8f1094..62efa9a 100644 --- a/lib/table.man +++ b/lib/table.man @@ -3,11 +3,11 @@ Sets the type of table formatting. The following types of \fIformat\fR are available: .RS -.ie '\*(PN'ovs\-vsctl' .IP "\fBtable\fR" -.el .IP "\fBtable\fR (default)" +.ie '\*(PN'ovsdb\-client' .IP "\fBtable\fR (default)" +.el .IP "\fBtable\fR" 2-D text tables with aligned columns. -.ie '\*(PN'ovs\-vsctl' .IP "\fBlist\fR (default)" -.el .IP "\fBlist\fR" +.ie '\*(PN'ovsdb\-client' .IP "\fBlist\fR" +.el .IP "\fBlist\fR (default)" A list with one column per line and rows separated by a blank line. .IP "\fBhtml\fR" HTML tables. diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index a01d132..af1eeab 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -206,7 +206,6 @@ parse_options(int argc, char *argv[], struct shash *local_options) allocated_options = ARRAY_SIZE(global_long_options); n_options = n_global_long_options; ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); - table_style.format = TF_LIST; for (;;) { int idx; diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c index 92ae3e5..c190635 100644 --- a/ovn/utilities/ovn-sbctl.c +++ b/ovn/utilities/ovn-sbctl.c @@ -200,7 +200,6 @@ parse_options(int argc, char *argv[], struct shash *local_options) allocated_options = ARRAY_SIZE(global_long_options); n_options = n_global_long_options; ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); - table_style.format = TF_LIST; for (;;) { int idx; diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index bd2f152..ba232fc 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -193,6 +193,8 @@ parse_options(int argc, char *argv[]) }; char *short_options = ovs_cmdl_long_options_to_short_options(long_options); + table_style.format = TF_TABLE; + for (;;) { int c; diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 41fa852..d6297fd 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -249,7 +249,6 @@ parse_options(int argc, char *argv[], struct shash *local_options) allocated_options = ARRAY_SIZE(global_long_options); n_options = n_global_long_options; ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); - table_style.format = TF_LIST; for (;;) { int idx; diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c index c57f592..1d8cbcb 100644 --- a/vtep/vtep-ctl.c +++ b/vtep/vtep-ctl.c @@ -202,7 +202,6 @@ parse_options(int argc, char *argv[], struct shash *local_options) allocated_options = ARRAY_SIZE(global_long_options); n_options = n_global_long_options; ctl_add_cmd_options(&options, &n_options, &allocated_options, OPT_LOCAL); - table_style.format = TF_LIST; for (;;) { int idx;
There are currently five users of the table formatting library, all of which default to "list" except for ovsdb-client which defaults to "table". The library current default is "table", and the table.man man page fragment only considers ovs-vsctl to use something other than "table" as a default.As a result, the man pages for ovn-sbctl and vtep-ctl are currently incorrect (these options aren't documented in the ovn-nbctl man page, which will need to be addressed in a future patch). Fix by making the library default format "list" and handling ovsdb-client as the exception. Signed-off-by: Lance Richardson <lrichard@redhat.com> --- lib/table.h | 2 +- lib/table.man | 8 ++++---- ovn/utilities/ovn-nbctl.c | 1 - ovn/utilities/ovn-sbctl.c | 1 - ovsdb/ovsdb-client.c | 2 ++ utilities/ovs-vsctl.c | 1 - vtep/vtep-ctl.c | 1 - 7 files changed, 7 insertions(+), 9 deletions(-)