pyenv/libexec/pyenv-completions

18 lines
420 B
Text
Raw Normal View History

#!/usr/bin/env bash
2013-01-18 08:41:41 +00:00
# Usage: pyenv completions <command> [arg1 arg2...]
set -e
[ -n "$PYENV_DEBUG" ] && set -x
COMMAND="$1"
if [ -z "$COMMAND" ]; then
2013-01-18 08:41:41 +00:00
pyenv-help --usage completions >&2
exit 1
fi
COMMAND_PATH="$(command -v "pyenv-$COMMAND" || command -v "pyenv-sh-$COMMAND")"
2014-01-02 19:58:29 +00:00
if grep -iE "^([#%]|--|//) provide pyenv completions" "$COMMAND_PATH" >/dev/null; then
shift
exec "$COMMAND_PATH" --complete "$@"
fi