From d0b690b584fa48946cfd93014aa6033ec0cc7fc3 Mon Sep 17 00:00:00 2001 From: Tommy Wang Date: Wed, 10 Jun 2015 10:01:38 -0500 Subject: [PATCH] use local options to set no_equals before sourcing bash completion script --- .../virtualenvwrapper/virtualenvwrapper.plugin.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 5faa1a823..b2c804edb 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,10 +1,18 @@ virtualenvwrapper='virtualenvwrapper.sh' if (( $+commands[$virtualenvwrapper] )); then - source ${${virtualenvwrapper}:c} + function { + setopt local_options + unsetopt equals + source ${${virtualenvwrapper}:c} + } elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then - virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper" - source "/etc/bash_completion.d/virtualenvwrapper" + function { + setopt local_options + unsetopt equals + virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper" + source "/etc/bash_completion.d/virtualenvwrapper" + } else print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\ "Please install with \`pip install virtualenvwrapper\`" >&2