Add --quiet option to activate and deactivate

This commit is contained in:
Yamashita Yuu
2014-07-04 20:47:10 +09:00
parent 5b3b909089
commit f0c400b669
4 changed files with 132 additions and 24 deletions

View File

@@ -9,6 +9,12 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
unset QUIET
if [ "$1" = "--quiet" ]; then
QUIET=1
shift 1
fi
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
case "$shell" in
fish )
@@ -27,23 +33,29 @@ fi
case "$shell" in
fish )
cat <<EOS
setenv PYENV_DEACTIVATE "\$VIRTUAL_ENV";
deactivate;
else
echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2;
false;
end;
EOS
echo " setenv PYENV_DEACTIVATE \"\$VIRTUAL_ENV\";"
;;
* )
cat <<EOS
export PYENV_DEACTIVATE="\$VIRTUAL_ENV";
deactivate;
else
echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2;
false;
fi;
EOS
echo " export PYENV_DEACTIVATE=\"\$VIRTUAL_ENV\";"
;;
esac
cat <<EOS
deactivate;
else
EOS
if [ -z "$QUIET" ]; then
echo " echo \"pyenv-virtualenv: no virtualenv has been activated.\" 1>&2;"
fi
echo " false;"
case "$shell" in
fish )
echo "end;"
;;
* )
echo "fi;"
;;
esac