1. Jeremy Cantrell
  2. virtualenvwrapper

Commits

Jeremy Cantrell  committed 8f2be7c

Changed zsh completion to use compdef instead of compctl

  • Participants
  • Parent commits 4478fa3
  • Branches default

Comments (0)

Files changed (1)

File virtualenvwrapper.sh

View file
     complete -o default -o nospace -F _virtualenvs rmvirtualenv
     complete -o default -o nospace -F _virtualenvs cpvirtualenv
 elif [ -n "$ZSH_VERSION" ] ; then
-    compctl -g "`virtualenvwrapper_show_workon_options`" workon rmvirtualenv cpvirtualenv
+    _virtualenvs ()
+    {
+        virtualenvwrapper_verify_workon_home || return 1
+        _values 'virtualenvs' $WORKON_HOME/**/bin/activate(:h:h:t)
+    }
+    compdef _virtualenvs workon rmvirtualenv cpvirtualenv
 fi
 
 # Prints the Python version string for the current interpreter.
 
 # Prints the path to the site-packages directory for the current environment.
 virtualenvwrapper_get_site_packages_dir () {
-    echo "$VIRTUAL_ENV/lib/python`virtualenvwrapper_get_python_version`/site-packages"    
+    echo "$VIRTUAL_ENV/lib/python`virtualenvwrapper_get_python_version`/site-packages"
 }
 
 # Path management for packages outside of the virtual env.