diff options
author | Michael Paquier <michael@paquier.xyz> | 2018-11-06 15:04:40 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2018-11-06 15:04:40 +0900 |
commit | add9182e59084faf57bb264fefcd39fbc93fb116 (patch) | |
tree | 2e25b2186ea57c94f178f650ad2bdb250baffda5 /src/bin/psql/command.c | |
parent | 8f045e242b2308473f5de532590454294e3d5683 (diff) |
Reorganize format options of psql in alphabetical order
This makes the addition of new formats easier, and documentation lookups
easier.
Author: Daniel Vérité
Reviewed-by: Fabien Coelho
Discussion: https://postgr.es/m/alpine.DEB.2.20.1803081004241.2916@lancre
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 5b4d54a4425..0dea54d3ce0 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3560,21 +3560,15 @@ _align2string(enum printFormat in) case PRINT_NOTHING: return "nothing"; break; - case PRINT_UNALIGNED: - return "unaligned"; - break; case PRINT_ALIGNED: return "aligned"; break; - case PRINT_WRAPPED: - return "wrapped"; + case PRINT_ASCIIDOC: + return "asciidoc"; break; case PRINT_HTML: return "html"; break; - case PRINT_ASCIIDOC: - return "asciidoc"; - break; case PRINT_LATEX: return "latex"; break; @@ -3584,6 +3578,12 @@ _align2string(enum printFormat in) case PRINT_TROFF_MS: return "troff-ms"; break; + case PRINT_UNALIGNED: + return "unaligned"; + break; + case PRINT_WRAPPED: + return "wrapped"; + break; } return "unknown"; } @@ -3639,25 +3639,25 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) { if (!value) ; - else if (pg_strncasecmp("unaligned", value, vallen) == 0) - popt->topt.format = PRINT_UNALIGNED; else if (pg_strncasecmp("aligned", value, vallen) == 0) popt->topt.format = PRINT_ALIGNED; - else if (pg_strncasecmp("wrapped", value, vallen) == 0) - 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("html", value, vallen) == 0) + popt->topt.format = PRINT_HTML; else if (pg_strncasecmp("latex", value, vallen) == 0) popt->topt.format = PRINT_LATEX; else if (pg_strncasecmp("latex-longtable", value, vallen) == 0) popt->topt.format = PRINT_LATEX_LONGTABLE; else if (pg_strncasecmp("troff-ms", value, vallen) == 0) popt->topt.format = PRINT_TROFF_MS; + else if (pg_strncasecmp("unaligned", value, vallen) == 0) + popt->topt.format = PRINT_UNALIGNED; + else if (pg_strncasecmp("wrapped", value, vallen) == 0) + popt->topt.format = PRINT_WRAPPED; else { - psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, asciidoc, latex, latex-longtable, troff-ms\n"); + psql_error("\\pset: allowed formats are aligned, asciidoc, html, latex, latex-longtable, troff-ms, unaligned, wrapped\n"); return false; } } |