diff --git a/libexec/pyenv-init b/libexec/pyenv-init index a60d70e6..57354995 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -24,14 +24,11 @@ no_rehash="" no_push_path="" shell="" -for arg in "$@"; do - case "$arg" in +while [ "$#" -gt 0 ]; do + case "$1" in -) mode="print" ;; - zsh|bash|ksh|fish) - shell="$arg" - ;; --path) mode="path" ;; @@ -45,11 +42,10 @@ for arg in "$@"; do no_rehash=1 ;; *) - echo "Warning: Unknown option '$arg'" >&2 - echo "Run 'pyenv init --help' for usage." >&2 - exit 1 + shell="$1" ;; esac + shift done # If shell is not provided, detect it.