Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (58 sloc) 2.585 kb
dc04530 @gmwils Add zsh completion for lein
gmwils authored
1 #compdef lein
2
3 # Lein ZSH completion function
4 # Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions)
5 # and rename it _lein
6
7 _lein() {
8 if (( CURRENT > 2 )); then
9 # shift words so _arguments doesn't have to be concerned with second command
10 (( CURRENT-- ))
11 shift words
12 # use _call_function here in case it doesn't exist
13 _call_function 1 _lein_${words[1]}
14 else
15 _values "lein command" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
16 "check[Check syntax and warn on reflection.]" \
dc04530 @gmwils Add zsh completion for lein
gmwils authored
17 "classpath[Print the classpath of the current project.]" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
18 "clean[Remove all files from project's target-path.]" \
dc04530 @gmwils Add zsh completion for lein
gmwils authored
19 "compile[Compile Clojure source into \.class files.]" \
20 "deploy[Build jar and deploy to remote repository.]" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
21 "deps[Download :dependencies.]" \
dc04530 @gmwils Add zsh completion for lein
gmwils authored
22 "help[Display a list of tasks or help for a given task.]" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
23 "install[Install current project to the local repository.]" \
dc04530 @gmwils Add zsh completion for lein
gmwils authored
24 "jack-in[Jack in to a Clojure SLIME session from Emacs.]" \
25 "jar[Package up all the project's files into a jar file.]" \
26 "javac[Compile Java source files.]" \
27 "new[Create a new project skeleton.]" \
28 "plugin[Manage user-level plugins.]" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
29 "pom[Write a pom.xml file to disk for Maven interoperability.]" \
30 "profiles[List all available profiles or display one if given an argument.]" \
dc04530 @gmwils Add zsh completion for lein
gmwils authored
31 "repl[Start a repl session either with the current project or standalone.]" \
32 "retest[Run only the test namespaces which failed last time around.]" \
33 "run[Run the project's -main function.]" \
34 "search[Search remote repositories.]" \
35 "swank[Launch swank server for Emacs to connect.]" \
36 "test[Run the project's tests.]" \
37 "trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
38 "uberjar[Package up the project files and all dependencies into a jar file.]" \
39 "upgrade[Upgrade Leiningen to the latest stable release.]" \
d255672 @technomancy Update news and bash/zsh completion scripts. Fixes #437.
authored
40 "version[Print version for Leiningen and the current JVM.]" \
41 "with-profile[Apply the given task with the profile(s) specified.]"
dc04530 @gmwils Add zsh completion for lein
gmwils authored
42 fi
43 }
44
45 _lein_plugin() {
46 _values "lein plugin commands" \
47 "install[Download, package, and install plugin jarfile into ~/.lein/plugins]" \
48 "uninstall[Delete the plugin jarfile: \[GROUP/\]ARTIFACT-ID VERSION]"
49 }
50
51
52 _lein_namespaces() {
53 if [ -d test ]; then
54 _values "lein valid namespaces" $(find $1 -type f -name "*.clj" -exec grep -E \
55 '^\(ns[[:space:]]+\w+' '{}' ';' | awk '/\(ns[ ]*([A-Za-z\.]+)/ {print $2}')
56 fi
57 }
58
59 _lein_run() {
60 _lein_namespaces "src/"
61 }
62
63 _lein_test() {
64 _lein_namespaces "test/"
65 }
66
Something went wrong with that request. Please try again.