Skip to content

Commit

Permalink
table: correct documented default format in man pages
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
hlrichardson authored and blp committed Dec 23, 2016
1 parent ddf3352 commit c4817da
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
8 changes: 4 additions & 4 deletions lib/table.man
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion ovn/utilities/ovn-nbctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion ovn/utilities/ovn-sbctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions ovsdb/ovsdb-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion utilities/ovs-vsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion vtep/vtep-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c4817da

Please sign in to comment.