aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-03-16 17:46:15 -0400
committerRobert Haas <rhaas@postgresql.org>2011-03-16 17:46:15 -0400
commitad3aff45f0d302b35d009e525de8a9d0ee9745a9 (patch)
tree836d4ab794e17e586b552432d6319e3d2e0da4c4
parent5f588e20051eb18333f6ea5b46bd779ba1eb8773 (diff)
downloadpostgresql-ad3aff45f0d302b35d009e525de8a9d0ee9745a9.tar.gz
postgresql-ad3aff45f0d302b35d009e525de8a9d0ee9745a9.zip
Tab completion for \pset format and \pset linestyle.
Pavel Stehule
-rw-r--r--src/bin/psql/tab-complete.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 7019123725d..e72c5b9e994 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2828,6 +2828,24 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_LIST(my_list);
}
+ else if (strcmp(prev2_wd, "\\pset") == 0)
+ {
+ if (strcmp(prev_wd, "format") == 0)
+ {
+ static const char *const my_list[] =
+ {"unaligned", "aligned", "wrapped", "html", "latex",
+ "troff-ms", NULL};
+
+ COMPLETE_WITH_LIST(my_list);
+ }
+ else if (strcmp(prev_wd, "linestyle") == 0)
+ {
+ static const char *const my_list[] =
+ {"ascii", "old-ascii", "unicode", NULL};
+
+ COMPLETE_WITH_LIST(my_list);
+ }
+ }
else if (strcmp(prev_wd, "\\set") == 0)
{
matches = complete_from_variables(text, "", "");