diff options
| author | Bruce Momjian <bruce@momjian.us> | 1999-12-10 03:59:30 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1999-12-10 03:59:30 +0000 |
| commit | 77a47299366e0246e3ec7419a9f8472281394b1e (patch) | |
| tree | f68c0692a91f465a5b3b1f4e765f0a7e61e936c4 /src/bin/psql/tab-complete.c | |
| parent | 97dec77fab612cfa285f6bd3dd5463a0d55526b2 (diff) | |
This should fix the \e (\p, \g, ...) behaviour on an empty query buffer.
Also, minor tweakage of tab completion, and I hope the output is flushed
on time now.
--
Peter Eisentraut Sernanders väg 10:115
Diffstat (limited to 'src/bin/psql/tab-complete.c')
| -rw-r--r-- | src/bin/psql/tab-complete.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index f2025b0d26a..2b08ff3f861 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -203,7 +203,7 @@ char ** psql_completion(char *text, int start, int end) (void)end; /* not used */ - rl_filename_quoting_desired = 1; + rl_completion_append_character = ' '; /* Clear a few things. */ completion_charp = NULL; @@ -501,6 +501,11 @@ char ** psql_completion(char *text, int start, int end) COMPLETE_WITH_QUERY(Query_for_list_of_tables); +/* ... FROM ... */ + else if (strcasecmp(prev_wd, "FROM") == 0 ) + COMPLETE_WITH_QUERY(Query_for_list_of_tables); + + /* Backslash commands */ else if (strcmp(prev_wd, "\\connect")==0 || strcmp(prev_wd, "\\c")==0) COMPLETE_WITH_QUERY(Query_for_list_of_databases); @@ -510,7 +515,7 @@ char ** psql_completion(char *text, int start, int end) COMPLETE_WITH_LIST(sql_commands); else if (strcmp(prev_wd, "\\pset")==0) { char * my_list[] = { "format", "border", "expanded", "null", "fieldsep", - "tuples_only", "title", "tableattr", "pager" }; + "tuples_only", "title", "tableattr", "pager", NULL }; COMPLETE_WITH_LIST(my_list); } else if( strcmp(prev_wd, "\\e")==0 || strcmp(prev_wd, "\\edit")==0 || @@ -541,8 +546,8 @@ char ** psql_completion(char *text, int start, int end) of default list. If we were to just return NULL, readline automatically attempts filename completion, and that's usually no good. */ if (matches == NULL) { - char * my_list[] = { "", "", NULL }; - COMPLETE_WITH_LIST(my_list); + COMPLETE_WITH_CONST(""); + rl_completion_append_character = '\0'; } |
