From 0c65cde9db1d0586ae9d9c5abec0bef978ff86a5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Feb 2010 14:38:05 -0800 Subject: [PATCH] ovsdb-client: Remove --wide option. This option just confused people, since no one really expected the output to be truncated at 79 columns by default. --- ovsdb/ovsdb-client.1.in | 6 ------ ovsdb/ovsdb-client.c | 19 ++++--------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in index 64a08119..119add3f 100644 --- a/ovsdb/ovsdb-client.1.in +++ b/ovsdb/ovsdb-client.1.in @@ -29,7 +29,6 @@ ovsdb\-client \- command-line interface to \fBovsdb-server\fR(1) \fBovsdb\-client help\fR .IP "Output formatting options:" [\fB--format=\fIformat\fR] -[\fB--wide\fR] [\fB--no-heading\fR] .so lib/daemon-syn.man .so lib/vlog-syn.man @@ -112,11 +111,6 @@ HTML tables. Comma-separated values as defined in RFC 4180. .RE . -.IP "\fB--wide\fR" -In \fBtable\fR output (the default), when standard output is a -terminal device, by default lines are truncated at a width of 79 -characters. Specifying this option prevents line truncation. -. .IP "\fB--no-heading\fR" This option suppresses the heading row that otherwise appears in the first row of table output. diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index acc41854..0900a675 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -50,9 +50,6 @@ static enum { FMT_CSV /* Comma-separated lines. */ } output_format; -/* --wide: For --format=table, the maximum output width. */ -static int output_width; - /* --no-headings: Whether table output should include headings. */ static int output_headings = true; @@ -84,7 +81,6 @@ parse_options(int argc, char *argv[]) OPT_BOOTSTRAP_CA_CERT = UCHAR_MAX + 1 }; static struct option long_options[] = { - {"wide", no_argument, &output_width, INT_MAX}, {"format", required_argument, 0, 'f'}, {"no-headings", no_argument, &output_headings, 0}, {"pretty", no_argument, &json_flags, JSSF_PRETTY | JSSF_SORT}, @@ -100,7 +96,6 @@ parse_options(int argc, char *argv[]) }; char *short_options = long_options_to_short_options(long_options); - output_width = isatty(fileno(stdout)) ? 79 : INT_MAX; for (;;) { int c; @@ -122,10 +117,6 @@ parse_options(int argc, char *argv[]) } break; - case 'w': - output_width = INT_MAX; - break; - case 'h': usage(); @@ -186,7 +177,6 @@ usage(void) printf("\nOutput formatting options:\n" " -f, --format=FORMAT set output formatting to FORMAT\n" " (\"table\", \"html\", or \"csv\"\n" - " --wide don't limit TTY lines to 79 bytes\n" " --no-headings omit table heading row\n" " --pretty pretty-print JSON in output"); daemon_usage(); @@ -404,9 +394,8 @@ table_add_cell(struct table *table, const char *format, ...) } static void -table_print_table_line__(struct ds *line, size_t max_width) +table_print_table_line__(struct ds *line) { - ds_truncate(line, max_width); puts(ds_cstr(line)); ds_clear(line); } @@ -425,7 +414,7 @@ table_print_table__(const struct table *table) } ds_put_format(&line, "%-*s", column->width, column->heading); } - table_print_table_line__(&line, output_width); + table_print_table_line__(&line); for (x = 0; x < table->n_columns; x++) { const struct column *column = &table->columns[x]; @@ -438,7 +427,7 @@ table_print_table__(const struct table *table) ds_put_char(&line, '-'); } } - table_print_table_line__(&line, output_width); + table_print_table_line__(&line); } for (y = 0; y < table->n_rows; y++) { @@ -449,7 +438,7 @@ table_print_table__(const struct table *table) } ds_put_format(&line, "%-*s", table->columns[x].width, cell); } - table_print_table_line__(&line, output_width); + table_print_table_line__(&line); } ds_destroy(&line); -- 2.30.2