commit
c5568e8ccf
1 changed files with 34 additions and 30 deletions
|
@ -13,32 +13,35 @@ _lein() {
|
|||
_call_function 1 _lein_${words[1]}
|
||||
else
|
||||
_values "lein command" \
|
||||
"check[Check syntax and warn on reflection.]" \
|
||||
"classpath[Print the classpath of the current project.]" \
|
||||
"clean[Remove all files from project's target-path.]" \
|
||||
"compile[Compile Clojure source into \.class files.]" \
|
||||
"deploy[Build jar and deploy to remote repository.]" \
|
||||
"deps[Download :dependencies.]" \
|
||||
"help[Display a list of tasks or help for a given task.]" \
|
||||
"install[Install current project to the local repository.]" \
|
||||
"jack-in[Jack in to a Clojure SLIME session from Emacs.]" \
|
||||
"jar[Package up all the project's files into a jar file.]" \
|
||||
"javac[Compile Java source files.]" \
|
||||
"new[Create a new project skeleton.]" \
|
||||
"plugin[Manage user-level plugins.]" \
|
||||
"pom[Write a pom.xml file to disk for Maven interoperability.]" \
|
||||
"profiles[List all available profiles or display one if given an argument.]" \
|
||||
"repl[Start a repl session either with the current project or standalone.]" \
|
||||
"retest[Run only the test namespaces which failed last time around.]" \
|
||||
"run[Run the project's -main function.]" \
|
||||
"search[Search remote repositories.]" \
|
||||
"swank[Launch swank server for Emacs to connect.]" \
|
||||
"test[Run the project's tests.]" \
|
||||
"trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
|
||||
"uberjar[Package up the project files and all dependencies into a jar file.]" \
|
||||
"upgrade[Upgrade Leiningen to the latest stable release.]" \
|
||||
"version[Print version for Leiningen and the current JVM.]" \
|
||||
"with-profile[Apply the given task with the profile(s) specified.]"
|
||||
"change[Rewrite project.clj by applying a function.]" \
|
||||
"check[Check syntax and warn on reflection.]" \
|
||||
"classpath[Print the classpath of the current project.]" \
|
||||
"clean[Remove all files from project's target-path.]" \
|
||||
"compile[Compile Clojure source into .class files.]" \
|
||||
"deploy[Build and deploy jar to remote repository.]" \
|
||||
"deps[Download all dependencies.]" \
|
||||
"do[Higher-order task to perform other tasks in succession.]" \
|
||||
"help[Display a list of tasks or help for a given task.]" \
|
||||
"install[Install the current project to the local repository.]" \
|
||||
"jar[Package up all the project's files into a jar file.]" \
|
||||
"javac[Compile Java source files.]" \
|
||||
"new[Generate project scaffolding based on a template.]" \
|
||||
"plugin[DEPRECATED. Please use the :user profile instead.]" \
|
||||
"pom[Write a pom.xml file to disk for Maven interoperability.]" \
|
||||
"release[Perform :release-tasks.]" \
|
||||
"repl[Start a repl session either with the current project or standalone.]" \
|
||||
"retest[Run only the test namespaces which failed last time around.]" \
|
||||
"run[Run a -main function with optional command-line arguments.]" \
|
||||
"search[Search remote maven repositories for matching jars.]" \
|
||||
"show-profiles[List all available profiles or display one if given an argument.]" \
|
||||
"test[Run the project's tests.]" \
|
||||
"trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
|
||||
"uberjar[Package up the project files and dependencies into a jar file.]" \
|
||||
"update-in[Perform arbitrary transformations on your project map.]" \
|
||||
"upgrade[Upgrade Leiningen to specified version or latest stable.]" \
|
||||
"vcs[Interact with the version control system.]" \
|
||||
"version[Print version for Leiningen and the current JVM.]" \
|
||||
"with-profile[Apply the given task with the profile(s) specified.]"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -50,12 +53,13 @@ _lein_plugin() {
|
|||
|
||||
|
||||
_lein_namespaces() {
|
||||
if [ -d test ]; then
|
||||
_values "lein valid namespaces" $(find $1 -type f -name "*.clj" -exec grep -E \
|
||||
'^\(ns[[:space:]]+\w+' '{}' ';' | awk '/\(ns[ ]*([A-Za-z\.]+)/ {print $2}')
|
||||
fi
|
||||
if [ -f "./project.clj" -a -d "$1" ]; then
|
||||
_values "lein valid namespaces" \
|
||||
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
_lein_run() {
|
||||
_lein_namespaces "src/"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue