Thread (13 messages) flat view 13 messages, 2 authors, 2016-06-15

Re: [PATCH] completion: clean up __gitcomp() tests

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:55:03

On Wed, Oct 17, 2012 at 7:54 PM, SZEDER Gábor [off-list ref] wrote:
Clean up two issues in the tests I added in 74a8c849 (tests: add tests
for the __gitcomp() completion helper function, 2012-04-17):

 - The COMPREPLY array is created using 'local -a' while in a
   subshell.  However, the local keyword should only be used in a
   shell function, and a variable created in a subshell is by
   definition local to that subshell.  Use 'declare -a' instead.

 - The contents of the COMPREPLY array is written through an IFS
   fiddling + echo + redirection combo, although there is the
   print_comp() helper function for exactly this purpose.
Makes sense. But this code seems awfully similar, a helper function might help.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help