From 3644840d4b23a00561f2500047f00aa8c1f234fb Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 13 Sep 2011 13:01:31 -0500 Subject: [PATCH] Show usage for `rbenv which` without an argument --- libexec/rbenv-which | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rbenv-which b/libexec/rbenv-which index 233c3e4f..cf5864a6 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -35,6 +35,11 @@ remove_from_path() { RBENV_VERSION="$(rbenv-version-name)" RBENV_COMMAND="$1" +if [ -z "$RBENV_COMMAND" ]; then + echo "usage: rbenv which COMMAND" >&2 + exit 1 +fi + if [ "$RBENV_VERSION" = "system" ]; then PATH="$(remove_from_path "${RBENV_ROOT}/shims")" RBENV_COMMAND_PATH="$(command -v "$RBENV_COMMAND")"