Skip to content

Commit

Permalink
Fix up namespace completion
Browse files Browse the repository at this point in the history
* Complete even when test dir is missing
* Remove trailing parentheses
* Use only one invocation of awk
  • Loading branch information
jgdavey committed Aug 18, 2014
1 parent 3ff6a1f commit 8c990e5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions zsh_completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ _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
_values "lein valid namespaces" \
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
}

_lein_run() {
Expand Down

0 comments on commit 8c990e5

Please sign in to comment.