ovsdb-client: Remove --wide option.
authorBen Pfaff <blp@nicira.com>
Wed, 10 Feb 2010 22:38:05 +0000 (14:38 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 15 Feb 2010 19:28:39 +0000 (11:28 -0800)
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
ovsdb/ovsdb-client.c

index 64a0811..119add3 100644 (file)
@@ -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.
index acc4185..0900a67 100644 (file)
@@ -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);