diff options
author | Max Persson <max@maxpersson.com> | 2011-12-07 13:32:58 +0100 |
---|---|---|
committer | Max Persson <max@maxpersson.com> | 2011-12-07 13:32:58 +0100 |
commit | 1c4997f5cada6f1ff1f205b20cf321cfc6b6d347 (patch) | |
tree | 76c0aced8cbd0dcb22eebe34fbb1e67b62495800 | |
parent | 42b0123427d2bdee0e3221d930bb48038c601932 (diff) | |
download | zsh-1c4997f5cada6f1ff1f205b20cf321cfc6b6d347.tar.gz zsh-1c4997f5cada6f1ff1f205b20cf321cfc6b6d347.tar.bz2 zsh-1c4997f5cada6f1ff1f205b20cf321cfc6b6d347.zip |
Added caching of packages
-rw-r--r-- | plugins/pip/_pip | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 8c03d8519..07d37c80e 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -4,7 +4,10 @@ # pip zsh completion, based on homebrew completion _pip_all() { - all_pkgs=(`pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'`) + # we cache the list of packages (originally from the macports plugin) + if (( ! $+piplist )); then + piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]')) + fi } _pip_installed() { @@ -62,7 +65,7 @@ case "$words[1]" in if [[ "$state" == packages ]]; then _pip_all - _wanted all_pkgs expl 'packages' compadd -a all_pkgs + _wanted piplist expl 'packages' compadd -a piplist fi ;; uninstall) _pip_installed |