From 0c7c62dc04dab195ff249bc93460a4c4c352ac00 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 21 Sep 2011 12:43:22 -0500 Subject: [PATCH] Show usage if no arguments are passed to rbenv-plugin-scripts --- libexec/rbenv-plugin-scripts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv-plugin-scripts b/libexec/rbenv-plugin-scripts index 2bc5bfdf..27568007 100755 --- a/libexec/rbenv-plugin-scripts +++ b/libexec/rbenv-plugin-scripts @@ -10,8 +10,14 @@ if [ "$1" = "--complete" ]; then exit fi +RBENV_COMMAND="$1" +if [ -z "$RBENV_COMMAND" ]; then + echo "usage: rbenv plugin-scripts COMMAND" >&2 + exit 1 +fi + shopt -s nullglob -SCRIPTS=(/etc/rbenv.d/$1/*.bash ${RBENV_ROOT}/rbenv.d/$1/*.bash) +SCRIPTS=(/etc/rbenv.d/"$RBENV_COMMAND"/*.bash ${RBENV_ROOT}/rbenv.d/"$RBENV_COMMAND"/*.bash) shopt -u nullglob for script in ${SCRIPTS[@]}; do