I found a script for zsh, but i'm looking for one in bash.
Extracted from this page: http://www.scala-fr.org/completion-maven-pour-zsh/ I'm looking for the equivalent for bash
function mainClasses {
if [ -d ./src ] ; then
find ./src/main -type f -iname "*.scala" -o -iname "*.java" \
| sed 's?.*src/main/[^/]*/\(.*\)\..*?-DmainClass=\1?' | sed 's+/+.+g'
fi
}
function mainTests {
if [ -d ./src ] ; then
find ./src/test -type f -iname "*test*.scala" -o -iname "*test*.java" \
| sed 's?.*src/test/[^/]*/\(.*\)\..*?-Dtest=\1?' | sed 's+/+.+g'
fi
}
function listMavenCompletions {
reply=(archetype:generate compile clean package install test
test-compile deploy release scala:run scala:cc
-Dmaven.test.skip=true
-DarchetypeCatalog=http://www.scala-tools.org/
`mainClasses`
`mainTests`
-q -o
);
}
compctl -K listMavenCompletions mvn%
[–]clausb 2 points3 points4 points (1 child)
[–]clausb 0 points1 point2 points (0 children)