Re: [HACKERS] Review: pset autocomplete add missing options

2013-11-19 Thread Fujii Masao
On Sun, Nov 17, 2013 at 8:47 PM, Ian Lawrence Barwick  wrote:
> Review for Pavel Stehule's patch in CF 2013-11:
>
>   https://commitfest.postgresql.org/action/patch_view?id=1253
>
> Patch applies cleanly and works as intended; it's a very straightforward
> patch so no surprises there.
>
> The patch expands the range of completable items for \pset, putting
> them in alphabetical order and syncs them with the list in command.c
> introduced by Gilles Darold's earlier patch for \pset without any
> options ( https://commitfest.postgresql.org/action/patch_view?id=1202 ).
>
> However double-checking the options available to \pset, I see there
> is also 'fieldsep_zero' and 'recordsep_zero', which are special cases
> for 'fieldsep' and 'recordsep' respectively and which are therefore not
> displayed separately by \pset without-any-options, but should nevertheless
> be tab-completable. Modified patch attached to include these.

Thanks! Committed.

Regards,

-- 
Fujii Masao


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


[HACKERS] Review: pset autocomplete add missing options

2013-11-17 Thread Ian Lawrence Barwick
Review for Pavel Stehule's patch in CF 2013-11:

  https://commitfest.postgresql.org/action/patch_view?id=1253

Patch applies cleanly and works as intended; it's a very straightforward
patch so no surprises there.

The patch expands the range of completable items for \pset, putting
them in alphabetical order and syncs them with the list in command.c
introduced by Gilles Darold's earlier patch for \pset without any
options ( https://commitfest.postgresql.org/action/patch_view?id=1202 ).

However double-checking the options available to \pset, I see there
is also 'fieldsep_zero' and 'recordsep_zero', which are special cases
for 'fieldsep' and 'recordsep' respectively and which are therefore not
displayed separately by \pset without-any-options, but should nevertheless
be tab-completable. Modified patch attached to include these.

Regards

Ian Barwick

PS I will endeavour to review a more complex patch
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
new file mode 100644
index 021b6c5..24a5c69
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*** psql_completion(char *text, int start, i
*** 3306,3314 
  	else if (strcmp(prev_wd, "\\pset") == 0)
  	{
  		static const char *const my_list[] =
! 		{"format", "border", "expanded",
! 			"null", "fieldsep", "tuples_only", "title", "tableattr",
! 		"linestyle", "pager", "recordsep", NULL};
  
  		COMPLETE_WITH_LIST_CS(my_list);
  	}
--- 3306,3315 
  	else if (strcmp(prev_wd, "\\pset") == 0)
  	{
  		static const char *const my_list[] =
! 		{"border", "columns", "expanded", "fieldsep", "fieldsep_zero",
! 		 "footer", "format", "linestyle", "null", "numericlocale",
! 		 "pager", "recordsep", "recordsep_zero", "tableattr", "title",
! 		 "tuples_only", NULL};
  
  		COMPLETE_WITH_LIST_CS(my_list);
  	}

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