views:

107

answers:

2

I added bash completion for Maven following the docs:

http://maven.apache.org/guides/mini/guide-bash-m2-completion.html

Everything works well except for goals that use a colon. For instance, instead of

mvn eclipse:eclipse

completion escapes the colon

mvn eclipse\:eclipse

Any suggestions how this can be fixed? I'm using Ubuntu 8.10 (2.6.27-17-generic) and

$ bash -version
GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)

+2  A: 

From Bash FAQ E13.

Just after the complete command in the script you linked to, issue this command to remove the colon from the list of completion word break characters:

COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
Dennis Williamson
Thank you! This thing has been bugging me for some time :)
armandino
A: 

Any suggestions how this can be fixed? I'm using Ubuntu 8.10 (2.6.27-17-generic) and

Dennis answer is definitely correct.

But for the record, there is a logged issue (MNG-3928) to improve the documentation about the Maven integration with bash. The issue has a script attached which is an improved version of the one currently online and just works. You might want to give it a try.

Personally, I use the Bash Completion script from Ludovic Claude's PPA (the one that is bundled into the maven package from Ubuntu) that I download directly from bazaar (her e is a direct download link to the HEAD revision). It is just awesome.

Pascal Thivent