1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 15:23:53 -05:00

search commands from python version stack.

users can use multiple python versions at once.
This commit is contained in:
Yamashita Yuu
2012-08-31 16:09:46 +09:00
parent 880ea61dd8
commit 8187bc84e3
11 changed files with 113 additions and 78 deletions

View File

@@ -9,24 +9,30 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare
fi
version="$1"
versions=()
for version in "$@"; do
versions=("${versions[@]}" "$version")
done
if [ -z "$version" ]; then
if [ -z "$PYENV_VERSION" ]; then
if [ -z "$versions" ]; then
if [ -z "$PYENV_VERSIONS" ]; then
echo "pyenv: no shell-specific version configured" >&2
exit 1
else
echo "echo \"\$PYENV_VERSION\""
echo "echo \"\$PYENV_VERSIONS\""
exit
fi
fi
if [ "$version" = "--unset" ]; then
echo "unset PYENV_VERSION"
if [ "$versions" = "--unset" ]; then
echo "unset PYENV_VERSIONS"
exit 1
fi
# Make sure the specified version is installed.
pyenv-prefix "$version" >/dev/null
pyenv-prefix $versions >/dev/null
echo "export PYENV_VERSION=\"${version}\""
{
IFS=:
echo "export PYENV_VERSIONS=\"${versions[*]}\""
}