mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Only shift if an argument is passed. Fixes #78.
This commit is contained in:
parent
1ba2ce0cb6
commit
fb6eee26d4
1 changed files with 8 additions and 5 deletions
|
@ -71,13 +71,16 @@ commands=(`rbenv commands --sh`)
|
||||||
IFS="|"
|
IFS="|"
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
function rbenv() {
|
function rbenv() {
|
||||||
command="\$1";
|
command="\$1"
|
||||||
shift;
|
if [ "\$#" -gt 0 ]; then
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
case "\$command" in
|
case "\$command" in
|
||||||
${commands[*]})
|
${commands[*]})
|
||||||
eval \`rbenv "sh-\$command" "\$@"\`;;
|
eval \`rbenv "sh-\$command" "\$@"\`;;
|
||||||
*)
|
*)
|
||||||
command rbenv "\$command" "\$@";;
|
command rbenv "\$command" "\$@";;
|
||||||
esac;
|
esac
|
||||||
};
|
}
|
||||||
EOS
|
EOS
|
||||||
|
|
Loading…
Reference in a new issue