Permalink
Browse files

smarter globbing in bash completions, and run in zcomp phase

  • Loading branch information...
1 parent e2321b9 commit 8b7062c80a9bf7efeaabcda0680d3e8de043c655 @rsanders committed Feb 11, 2012
Showing with 7 additions and 8 deletions.
  1. +7 −8 zsh/plugins/bash-completions/{zshrc.zsh → zcomp.zsh}
@@ -2,17 +2,16 @@
function () {
if ! bashcompinit >/dev/null 2>&1; then
- autoload -U bashcompinit
- bashcompinit -i
+ autoload -U bashcompinit
+ bashcompinit -i
fi
- local bashfile
- typeset -a BASH_COMPLETION_DIRS
+ typeset -g -a BASH_COMPLETION_DIRS
BASH_COMPLETION_DIRS+=( /etc/bash_completion.d /usr/local/etc/bash_completion.d )
- path~glob_in_dirs '*' $bashcompdirs
-
- for bashfile in $reply; do
- source $bashfile 2>/dev/null
+ # source all bash completion files found
+ local bashfile
+ for bashfile in ${^BASH_COMPLETION_DIRS}/*(-N.); do
+ source $bashfile 2>/dev/null
done
}

0 comments on commit 8b7062c

Please sign in to comment.