Created
April 15, 2010 18:06
-
-
Save timcharper/367421 to your computer and use it in GitHub Desktop.
bash completion for leiningen
This file contains 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
_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 |
on mac os x
cp lein-completion.bash /usr/local/etc/bash_completion.d/lein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: