ovs-vsctl-bashcomp: Avoid setting the COMP_WORDBREAKS.
authorAlex Wang <alexw@nicira.com>
Fri, 13 Mar 2015 21:47:25 +0000 (14:47 -0700)
committerAlex Wang <alexw@nicira.com>
Fri, 20 Mar 2015 23:42:42 +0000 (16:42 -0700)
commitbb5dbe78592b3f39f0e7e6361c8796a5023363e5
treee8baaafc0b8217d05def9739f65685b50d4609f5
parent777cb78767fd0ca821dad79691ee3200de66f06e
ovs-vsctl-bashcomp: Avoid setting the COMP_WORDBREAKS.

Modifying $COMP_WORDBREAKS in completion script is not the recommended
as it is a global variable and the modification could affect the behavior
of other completion scripts.  As a workaround, this commit uses the
_get_comp_words_by_ref which allows user to exclude characters out of
$COMP_WORDBREAKS and reassemble input command line.  However, as a side
effect, the bash completion module cannot handle characters defined in
$COMP_WORDBREAKS (e.g. ':' and '=') correctly in the resulting completions.
Thusly, we need to trim the colon-word and equal-word prefixes from reply.

Signed-off-by: Alex Wang <alexw@nicira.com>
tests/completion.at
utilities/ovs-vsctl-bashcomp.bash