]> granicus.if.org Git - postgresql/commitdiff
Tab completion for \pset format and \pset linestyle.
authorRobert Haas <rhaas@postgresql.org>
Wed, 16 Mar 2011 21:46:15 +0000 (17:46 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 16 Mar 2011 21:46:15 +0000 (17:46 -0400)
Pavel Stehule

src/bin/psql/tab-complete.c

index 7019123725d3d8c30a779c572fd73759e25d8460..e72c5b9e994e2cb233c8d7166aaee7d827d28f0c 100644 (file)
@@ -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, "", "");