aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-03 17:10:25 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-03 17:10:25 -0400
commitf1175556a17a193395326f45a3e595b4aa3a9eff (patch)
tree3792e7a335cc41c3cfeaa297105c7ef5ad297d41
parent512c7356b6574e7622fddb713f96dc8407960680 (diff)
downloadpostgresql-f1175556a17a193395326f45a3e595b4aa3a9eff.tar.gz
postgresql-f1175556a17a193395326f45a3e595b4aa3a9eff.zip
Add some missing backslash commands to psql's tab-completion knowledge.
\if and related commands were overlooked here, as were \dRp and \dRs from the logical-replication patch, as was \?. While here, reformat the list to put each new first command letter on a separate line; perhaps that will limit the need to reflow the whole list when we add more commands in future. Masahiko Sawada (reformatting by me) Discussion: https://postgr.es/m/CAD21AoDW1QHtBsM33hV+Fg2mYEs+FWj4qtoCU72AwHAXQ3U6ZQ@mail.gmail.com
-rw-r--r--src/bin/psql/tab-complete.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2abd08758df..d4b6976ad3b 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1421,19 +1421,33 @@ psql_completion(const char *text, int start, int end)
/* psql's backslash commands. */
static const char *const backslash_commands[] = {
- "\\a", "\\connect", "\\conninfo", "\\C", "\\cd", "\\copy",
+ "\\a",
+ "\\connect", "\\conninfo", "\\C", "\\cd", "\\copy",
"\\copyright", "\\crosstabview",
"\\d", "\\da", "\\dA", "\\db", "\\dc", "\\dC", "\\dd", "\\ddp", "\\dD",
"\\des", "\\det", "\\deu", "\\dew", "\\dE", "\\df",
"\\dF", "\\dFd", "\\dFp", "\\dFt", "\\dg", "\\di", "\\dl", "\\dL",
- "\\dm", "\\dn", "\\do", "\\dO", "\\dp", "\\drds", "\\ds", "\\dS",
+ "\\dm", "\\dn", "\\do", "\\dO", "\\dp",
+ "\\drds", "\\dRs", "\\dRp", "\\ds", "\\dS",
"\\dt", "\\dT", "\\dv", "\\du", "\\dx", "\\dy",
- "\\e", "\\echo", "\\ef", "\\encoding", "\\errverbose", "\\ev",
- "\\f", "\\g", "\\gexec", "\\gset", "\\gx", "\\h", "\\help", "\\H",
- "\\i", "\\ir", "\\l", "\\lo_import", "\\lo_export", "\\lo_list",
- "\\lo_unlink", "\\o", "\\p", "\\password", "\\prompt", "\\pset", "\\q",
- "\\qecho", "\\r", "\\s", "\\set", "\\setenv", "\\sf", "\\sv", "\\t",
- "\\T", "\\timing", "\\unset", "\\x", "\\w", "\\watch", "\\z", "\\!",
+ "\\e", "\\echo", "\\ef", "\\elif", "\\else", "\\encoding",
+ "\\endif", "\\errverbose", "\\ev",
+ "\\f",
+ "\\g", "\\gexec", "\\gset", "\\gx",
+ "\\h", "\\help", "\\H",
+ "\\i", "\\if", "\\ir",
+ "\\l", "\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
+ "\\o",
+ "\\p", "\\password", "\\prompt", "\\pset",
+ "\\q", "\\qecho",
+ "\\r",
+ "\\s", "\\set", "\\setenv", "\\sf", "\\sv",
+ "\\t", "\\T", "\\timing",
+ "\\unset",
+ "\\x",
+ "\\w", "\\watch",
+ "\\z",
+ "\\!", "\\?",
NULL
};