tab-completion for \lo_import

Started by Josh Kupershmidtover 12 years ago2 messages
#1Josh Kupershmidt
schmiddy@gmail.com
1 attachment(s)

Hi all,
Is there any reason not to tab-complete the local filename used by the
\lo_import command? Small patch to do so attached.
Josh

Attachments:

tab_complete_lo_import.diffapplication/octet-stream; name=tab_complete_lo_import.diffDownload
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
new file mode 100644
index 8eb9f83..a67d2cd
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*************** psql_completion(char *text, int start, i
*** 3359,3365 ****
  			 strcmp(prev_wd, "\\ir") == 0 || strcmp(prev_wd, "\\include_relative") == 0 ||
  			 strcmp(prev_wd, "\\o") == 0 || strcmp(prev_wd, "\\out") == 0 ||
  			 strcmp(prev_wd, "\\s") == 0 ||
! 			 strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
  		)
  	{
  		completion_charp = "\\";
--- 3359,3366 ----
  			 strcmp(prev_wd, "\\ir") == 0 || strcmp(prev_wd, "\\include_relative") == 0 ||
  			 strcmp(prev_wd, "\\o") == 0 || strcmp(prev_wd, "\\out") == 0 ||
  			 strcmp(prev_wd, "\\s") == 0 ||
! 			 strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0 ||
! 			 strcmp(prev_wd, "\\lo_import") == 0
  		)
  	{
  		completion_charp = "\\";
#2Robert Haas
robertmhaas@gmail.com
In reply to: Josh Kupershmidt (#1)
Re: tab-completion for \lo_import

On Wed, Jul 10, 2013 at 11:28 AM, Josh Kupershmidt <schmiddy@gmail.com> wrote:

Is there any reason not to tab-complete the local filename used by the
\lo_import command? Small patch to do so attached.

Looks good to me. Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers