char *separator; /* Field separator (usually comma or tab). */
char *quote_set; /* Characters that force quoting. */
+ bool captions; /* Print table captions? */
+
char *file_name; /* Output file name. */
char *command_name; /* Current command. */
FILE *file; /* Output file. */
csv->separator = parse_string (opt (d, o, "separator", ","));
csv->quote_set = xasprintf ("\"\n\r\t%s", csv->separator);
+ csv->captions = parse_boolean (opt (d, o, "captions", "true"));
csv->file_name = xstrdup (file_name);
csv->file = fn_open (csv->file_name, "w");
csv->n_items = 0;
csv_put_separator (csv);
- if (caption != NULL)
+ if (csv->captions && caption != NULL)
{
csv_output_field_format (csv, "Table: %s", caption);
putc ('\n', csv->file);