Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bbe905

Browse files
author
Neil Conway
committed
Minor fixes for psql tab completion. Spell "absolute" like the English word,
not the brand of vodka. Complete FETCH <sth> <sth> with FROM and IN, not FROM and TO (which is still pretty incomplete, but at least its the right syntax).
1 parent dba561f commit 8bbe905

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/bin/psql/tab-complete.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.122 2005/03/19 23:27:08 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.123 2005/04/04 07:19:44 neilc Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -1186,7 +1186,7 @@ psql_completion(char *text, int start, int end)
11861186
pg_strcasecmp(prev_wd, "MOVE") == 0)
11871187
{
11881188
static const char *const list_FETCH1[] =
1189-
{"ABSOLUT", "BACKWARD", "FORWARD", "RELATIVE", NULL};
1189+
{"ABSOLUTE", "BACKWARD", "FORWARD", "RELATIVE", NULL};
11901190

11911191
COMPLETE_WITH_LIST(list_FETCH1);
11921192
}
@@ -1201,16 +1201,17 @@ psql_completion(char *text, int start, int end)
12011201
}
12021202

12031203
/*
1204-
* Complete FETCH <sth1> <sth2> with "FROM" or "TO". (Is there a
1205-
* difference? If not, remove one.)
1204+
* Complete FETCH <sth1> <sth2> with "FROM" or "IN". These are
1205+
* equivalent, but we may as well tab-complete both: perhaps some
1206+
* users prefer one variant or the other.
12061207
*/
12071208
else if (pg_strcasecmp(prev3_wd, "FETCH") == 0 ||
12081209
pg_strcasecmp(prev3_wd, "MOVE") == 0)
12091210
{
1210-
static const char *const list_FROMTO[] =
1211-
{"FROM", "TO", NULL};
1211+
static const char *const list_FROMIN[] =
1212+
{"FROM", "IN", NULL};
12121213

1213-
COMPLETE_WITH_LIST(list_FROMTO);
1214+
COMPLETE_WITH_LIST(list_FROMIN);
12141215
}
12151216

12161217
/* GRANT && REVOKE*/

0 commit comments

Comments
 (0)