Files
pyenv/libexec/pyenv-commands
admin b622f8abd2
Some checks are pending
macos_build / macos_build (3.10) (push) Waiting to run
macos_build / macos_build (3.11) (push) Waiting to run
macos_build / macos_build (3.12) (push) Waiting to run
macos_build / macos_build (3.13) (push) Waiting to run
macos_build / macos_build (3.14) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-14) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-15) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-15-intel) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-26) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Waiting to run
ubuntu_build / ubuntu_build (3.10) (push) Waiting to run
ubuntu_build / ubuntu_build (3.11) (push) Waiting to run
ubuntu_build / ubuntu_build (3.12) (push) Waiting to run
ubuntu_build / ubuntu_build (3.13) (push) Waiting to run
ubuntu_build / ubuntu_build (3.14) (push) Waiting to run
pyenv verification source
2026-05-22 16:45:42 +08:00

49 lines
884 B
Bash
Executable File

#!/usr/bin/env bash
# Summary: List all available pyenv commands
# Usage: pyenv commands [--sh|--no-sh]
set -e
[[ -n $PYENV_DEBUG ]] && set -x
# Provide pyenv completions
if [[ $1 = "--complete" ]]; then
echo --sh
echo --no-sh
exit
fi
if [[ $1 = "--sh" ]]; then
sh=1
shift
elif [[ $1 = "--no-sh" ]]; then
nosh=1
shift
fi
IFS=: paths=($PATH)
shopt -s nullglob
{
if [[ -n $sh ]]; then
for path in "${paths[@]}"; do
for command in "${path}"/pyenv-sh-*; do
echo "${command##*/pyenv-sh-}"
done
done
else
for path in "${paths[@]}"; do
for command in "${path}"/pyenv-*; do
command="${command##*/pyenv-}"
if [[ -n $nosh ]]; then
if [[ ${command:0:3} != "sh-" ]]; then
echo "$command"
fi
else
echo "${command##sh-}"
fi
done
done
fi
} | sort -u