Re: [PATCH] completion: clean up __gitcomp() tests
On Wed, Oct 17, 2012 at 7:54 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:
Show 11 quoted lines
> 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