mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 15:20:08 +00:00
Added caching of packages
This commit is contained in:
parent
42b0123427
commit
1c4997f5ca
1 changed files with 5 additions and 2 deletions
|
@ -4,7 +4,10 @@
|
||||||
# pip zsh completion, based on homebrew completion
|
# pip zsh completion, based on homebrew completion
|
||||||
|
|
||||||
_pip_all() {
|
_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() {
|
_pip_installed() {
|
||||||
|
@ -62,7 +65,7 @@ case "$words[1]" in
|
||||||
|
|
||||||
if [[ "$state" == packages ]]; then
|
if [[ "$state" == packages ]]; then
|
||||||
_pip_all
|
_pip_all
|
||||||
_wanted all_pkgs expl 'packages' compadd -a all_pkgs
|
_wanted piplist expl 'packages' compadd -a piplist
|
||||||
fi ;;
|
fi ;;
|
||||||
uninstall)
|
uninstall)
|
||||||
_pip_installed
|
_pip_installed
|
||||||
|
|
Loading…
Reference in a new issue