Created
October 9, 2011 18:43
-
-
Save sourcerebels/1274002 to your computer and use it in GitHub Desktop.
maven-completion.bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_m2_make_goals() | |
{ | |
plugin=$1 | |
mojos=$2 | |
for mojo in $mojos | |
do | |
export goals="$goals $plugin:$mojo" | |
done | |
} | |
_m2_complete() | |
{ | |
local cur goals | |
COMPREPLY=() | |
cur=${COMP_WORDS[COMP_CWORD]} | |
goals='clean compile test install package deploy site' | |
goals=$goals _m2_make_goals "eclipse" "eclipse" | |
goals=$goals _m2_make_goals "idea" "idea" | |
goals=$goals _m2_make_goals "assembly" "assembly" | |
goals=$goals _m2_make_goals "plexus" "app bundle-application bundle-runtime descriptor runtime service" | |
cur=`echo $cur | sed 's/\\\\//g'` | |
COMPREPLY=($(compgen -W "${goals}" ${cur} | sed 's/\\\\//g') ) | |
} | |
complete -F _m2_complete -o filenames mvn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment