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