Only shift if an argument is passed. Fixes #78.

This commit is contained in:
Sam Stephenson 2011-09-10 19:50:12 -05:00
parent 1ba2ce0cb6
commit fb6eee26d4

View file

@ -71,13 +71,16 @@ commands=(`rbenv commands --sh`)
IFS="|"
cat <<EOS
function rbenv() {
command="\$1";
shift;
command="\$1"
if [ "\$#" -gt 0 ]; then
shift
fi
case "\$command" in
${commands[*]})
eval \`rbenv "sh-\$command" "\$@"\`;;
*)
command rbenv "\$command" "\$@";;
esac;
};
esac
}
EOS