aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2015-03-31 11:33:25 -0400
committerBruce Momjian <bruce@momjian.us>2015-03-31 11:33:25 -0400
commit9d9991c84e64c0c5f568b3cdaf46bb91a1368b5a (patch)
tree3c9464838f27188885266bb0f190e4c3ea7f1e1b /src/bin/psql/command.c
parent0cf16b44cb749cac2ff9dcbbe92bfb94f72bb0d0 (diff)
downloadpostgresql-9d9991c84e64c0c5f568b3cdaf46bb91a1368b5a.tar.gz
postgresql-9d9991c84e64c0c5f568b3cdaf46bb91a1368b5a.zip
psql: add asciidoc output format
Patch by Szymon Guz, adjustments by me Testing by Michael Paquier, Pavel Stehule
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index e64c033bf8c..916f1c6301e 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2249,6 +2249,9 @@ _align2string(enum printFormat in)
case PRINT_HTML:
return "html";
break;
+ case PRINT_ASCIIDOC:
+ return "asciidoc";
+ break;
case PRINT_LATEX:
return "latex";
break;
@@ -2325,6 +2328,8 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->topt.format = PRINT_WRAPPED;
else if (pg_strncasecmp("html", value, vallen) == 0)
popt->topt.format = PRINT_HTML;
+ else if (pg_strncasecmp("asciidoc", value, vallen) == 0)
+ popt->topt.format = PRINT_ASCIIDOC;
else if (pg_strncasecmp("latex", value, vallen) == 0)
popt->topt.format = PRINT_LATEX;
else if (pg_strncasecmp("latex-longtable", value, vallen) == 0)
@@ -2333,7 +2338,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->topt.format = PRINT_TROFF_MS;
else
{
- psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n");
+ psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, asciidoc, latex, troff-ms\n");
return false;
}