From a8ca63fcc0d6b470e2d5fc18fb85fad90efd4a59 Mon Sep 17 00:00:00 2001 From: Brian Dowling Date: Thu, 19 Mar 2020 17:35:46 -0400 Subject: [PATCH] Update help docs to clarify multiple version(s) are allowed (#1197) * Update help docs to clarify multiple version(s) are allowed * Tweek version(s) help description --- libexec/pyenv-global | 20 ++++++++++++++------ libexec/pyenv-local | 19 +++++++++++++------ libexec/pyenv-version | 4 ++-- libexec/pyenv-which | 3 +++ test/which.bats | 3 +++ 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/libexec/pyenv-global b/libexec/pyenv-global index 102e082a..dd9dae97 100755 --- a/libexec/pyenv-global +++ b/libexec/pyenv-global @@ -1,16 +1,24 @@ #!/usr/bin/env bash # -# Summary: Set or show the global Python version +# Summary: Set or show the global Python version(s) # -# Usage: pyenv global +# Usage: pyenv global <..> # -# Sets the global Python version. You can override the global version at +# Sets the global Python version(s). You can override the global version at # any time by setting a directory-specific version with `pyenv local' # or by setting the `PYENV_VERSION' environment variable. # -# should be a string matching a Python version known to pyenv. -# The special version string `system' will use your default system Python. -# Run `pyenv versions' for a list of available Python versions. +# can be specified multiple times and should be a version +# tag known to pyenv. The special version string `system' will use +# your default system Python. Run `pyenv versions' for a list of +# available Python versions. +# +# Example: To enable the python2.7 and python3.7 shims to find their +# respective executables you could set both versions with: +# +# 'pyenv global 3.7.0 2.7.15' +# + set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/libexec/pyenv-local b/libexec/pyenv-local index 8a2a6747..c0389281 100755 --- a/libexec/pyenv-local +++ b/libexec/pyenv-local @@ -1,11 +1,11 @@ #!/usr/bin/env bash # -# Summary: Set or show the local application-specific Python version +# Summary: Set or show the local application-specific Python version(s) # -# Usage: pyenv local +# Usage: pyenv local <..> # pyenv local --unset # -# Sets the local application-specific Python version by writing the +# Sets the local application-specific Python version(s) by writing the # version name to a file named `.python-version'. # # When you run a Python command, pyenv will look for a `.python-version' @@ -15,9 +15,16 @@ # `PYENV_VERSION' environment variable takes precedence over local # and global versions. # -# should be a string matching a Python version known to pyenv. -# The special version string `system' will use your default system Python. -# Run `pyenv versions' for a list of available Python versions. +# can be specified multiple times and should be a version +# tag known to pyenv. The special version string `system' will use +# your default system Python. Run `pyenv versions' for a list of +# available Python versions. +# +# Example: To enable the python2.7 and python3.7 shims to find their +# respective executables you could set both versions with: +# +# 'pyenv local 3.7.0 2.7.15' + set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/libexec/pyenv-version b/libexec/pyenv-version index dd5fa29a..33de9325 100755 --- a/libexec/pyenv-version +++ b/libexec/pyenv-version @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Summary: Show the current Python version and its origin +# Summary: Show the current Python version(s) and its origin # -# Shows the currently selected Python version and how it was +# Shows the currently selected Python version(s) and how it was # selected. To obtain only the version string, use `pyenv # version-name'. diff --git a/libexec/pyenv-which b/libexec/pyenv-which index 9551f6cf..22793472 100755 --- a/libexec/pyenv-which +++ b/libexec/pyenv-which @@ -6,6 +6,7 @@ # # Displays the full path to the executable that pyenv will invoke when # you run the given command. +# set -e [ -n "$PYENV_DEBUG" ] && set -x @@ -82,6 +83,8 @@ else echo "The \`$1' command exists in these Python versions:" echo "$versions" | sed 's/^/ /g' echo + echo "Note: See 'pyenv help global' for tips on allowing both" + echo " python2 and python3 to be found." } >&2 fi diff --git a/test/which.bats b/test/which.bats index 5145cdb4..4fc5eecb 100644 --- a/test/which.bats +++ b/test/which.bats @@ -107,6 +107,9 @@ pyenv: py.test: command not found The \`py.test' command exists in these Python versions: 3.3 3.4 + +Note: See 'pyenv help global' for tips on allowing both + python2 and python3 to be found. OUT }