1) Made --quiet as opposite of --verbose 2) Suppress warning about prompts on --quiet

This commit is contained in:
Yamashita, Yuu
2016-05-02 01:07:48 +00:00
parent b952f573ba
commit c64aebef08
5 changed files with 65 additions and 8 deletions

View File

@@ -24,7 +24,6 @@ resolve_link() {
unset FORCE
unset QUIET
unset VERBOSE
while [ $# -gt 0 ]; do
case "$1" in
@@ -47,7 +46,7 @@ while [ $# -gt 0 ]; do
exec pyenv-sh-deactivate
;;
"-v" | "--verbose" )
VERBOSE=1
unset QUIET
;;
* )
break
@@ -136,7 +135,7 @@ if [[ "${VIRTUAL_ENV}" == "${prefix}" ]]; then
fi
fi
pyenv-sh-deactivate --force --quiet ${VERBOSE+--verbose} || true
pyenv-sh-deactivate --force --quiet || true
if [ -n "$PYENV_VIRTUALENV_VERBOSE_ACTIVATE" ]; then
echo "pyenv-virtualenv: activate ${venv}" 1>&2
@@ -220,10 +219,14 @@ PYENV_VIRTUALENV_DISABLE_PROMPT="${PYENV_VIRTUALENV_DISABLE_PROMPT:-${VIRTUAL_EN
if [ -z "${PYENV_VIRTUALENV_DISABLE_PROMPT}" ]; then
case "${shell}" in
fish )
echo "pyenv-virtualenv: prompt changing not working for fish." 1>&2
if [ -z "${QUIET}" ]; then
echo "pyenv-virtualenv: prompt changing not working for fish." 1>&2
fi
;;
* )
echo "pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior." 1>&2
if [ -z "${QUIET}" ]; then
echo "pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior." 1>&2
fi
cat <<EOS
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(${venv}) \${PS1}";