pyenv/libexec/pyenv-version

21 lines
509 B
Text
Raw Permalink Normal View History

#!/usr/bin/env bash
# Summary: Show the current Python version(s) and its origin
2013-01-18 03:41:41 -05:00
#
# Shows the currently selected Python version(s) and how it was
2013-01-18 03:41:41 -05:00
# selected. To obtain only the version string, use `pyenv
# version-name'.
set -e
[ -n "$PYENV_DEBUG" ] && set -x
exitcode=0
2013-08-15 09:29:14 -04:00
OLDIFS="$IFS"
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name)) || exitcode=$?
2013-08-15 09:29:14 -04:00
IFS="$OLDIFS"
for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
done
exit $exitcode