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

Import changes from recent rbenv

This commit is contained in:
Yamashita Yuu
2014-01-03 04:58:29 +09:00
parent 12d4fdb307
commit 5dea3c9e63
6 changed files with 30 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ if [ -z "$COMMAND" ]; then
fi
COMMAND_PATH="$(command -v "pyenv-$COMMAND" || command -v "pyenv-sh-$COMMAND")"
if grep -i "^\([#%]\|--\|//\) provide pyenv completions" "$COMMAND_PATH" >/dev/null; then
if grep -iE "^([#%]|--|//) provide pyenv completions" "$COMMAND_PATH" >/dev/null; then
shift
exec "$COMMAND_PATH" --complete "$@"
fi

View File

@@ -22,8 +22,9 @@ done
shell="$1"
if [ -z "$shell" ]; then
shell="$(ps c -p $(ps -p $$ -o 'ppid=' 2>/dev/null) -o 'comm=' 2>/dev/null || true)"
shell="$(ps c -p "$PPID" -o 'ucomm=' 2>/dev/null || true)"
shell="${shell##-}"
shell="${shell%% *}"
shell="$(basename "${shell:-$SHELL}")"
fi