2019-04-23 10:23:33 -04:00
|
|
|
#!/usr/bin/env bash
|
2013-01-18 17:41:41 +09:00
|
|
|
# Summary: List existing pyenv shims
|
|
|
|
|
# Usage: pyenv shims [--short]
|
|
|
|
|
|
2026-10-13 19:20:36 +02:00
|
|
|
set -euo pipefail
|
|
|
|
|
[ -n "${PYENV_DEBUG:-}" ] && set -x
|
2012-08-31 15:23:41 +09:00
|
|
|
|
|
|
|
|
# Provide pyenv completions
|
2026-10-13 19:20:36 +02:00
|
|
|
if [ "${1:-}" = "--complete" ]; then
|
2012-08-31 15:23:41 +09:00
|
|
|
echo --short
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2014-01-02 22:26:22 +09:00
|
|
|
shopt -s nullglob
|
|
|
|
|
|
2012-08-31 15:23:41 +09:00
|
|
|
for command in "${PYENV_ROOT}/shims/"*; do
|
2026-10-13 19:20:36 +02:00
|
|
|
if [ "${1:-}" = "--short" ]; then
|
2012-08-31 15:23:41 +09:00
|
|
|
echo "${command##*/}"
|
|
|
|
|
else
|
|
|
|
|
echo "$command"
|
|
|
|
|
fi
|
|
|
|
|
done | sort
|