aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r--src/bin/psql/startup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index be57574cd32..e7536a8a06f 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -144,6 +144,9 @@ main(int argc, char *argv[])
pset.popt.topt.stop_table = true;
pset.popt.topt.default_footer = true;
+ pset.popt.topt.csvFieldSep[0] = DEFAULT_CSV_FIELD_SEP;
+ pset.popt.topt.csvFieldSep[1] = '\0';
+
pset.popt.topt.unicode_border_linestyle = UNICODE_LINESTYLE_SINGLE;
pset.popt.topt.unicode_column_linestyle = UNICODE_LINESTYLE_SINGLE;
pset.popt.topt.unicode_header_linestyle = UNICODE_LINESTYLE_SINGLE;
@@ -468,6 +471,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts *options)
{"expanded", no_argument, NULL, 'x'},
{"no-psqlrc", no_argument, NULL, 'X'},
{"help", optional_argument, NULL, 1},
+ {"csv", no_argument, NULL, 2},
{NULL, 0, NULL, 0}
};
@@ -658,6 +662,9 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts *options)
exit(EXIT_SUCCESS);
}
break;
+ case 2:
+ pset.popt.topt.format = PRINT_CSV;
+ break;
default:
unknown_option:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),