bash completion for leiningen
_lein_test() | |
{ | |
local curw | |
COMPREPLY=() | |
curw=${COMP_WORDS[COMP_CWORD]} | |
if [ -d test ]; then | |
COMPREPLY=($(compgen -W '$(cd test; find * -name \*.clj | sed "s/.clj\$//" | sed "s/_/-/g" | sed "s|/|.|g")' -- $curw)); | |
return 0 | |
fi | |
} | |
_lein() | |
{ | |
if [ $COMP_CWORD == 1 ]; then | |
curw=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "repl pom help install jar test deps uberjar clean compile version swank new" -- $curw) ) | |
return 0 | |
else | |
case ${COMP_WORDS[1]} in | |
test) _lein_test ;; | |
esac | |
fi | |
} | |
complete -F _lein -o default lein |
This comment has been minimized.
This comment has been minimized.
on mac os x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Note that a (different) version of this file is available in the Leiningen repo:
https://github.com/technomancy/leiningen/blob/master/bash_completion.bash
Rename and copy that file as: