Show usage if no arguments are passed to rbenv-plugin-scripts

This commit is contained in:
Sam Stephenson 2011-09-21 12:43:22 -05:00
parent 2b5fb40b99
commit 0c7c62dc04

View file

@ -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