scripts/help in rvm-1.0.9 vs scripts/help in rvm-1.0.10
- old
+ new
@@ -1,23 +1,38 @@
#!/usr/bin/env bash
+
rvm_base_except="selector"
+
source "$rvm_path/scripts/base"
rvm_help_path="${rvm_help_path:-"$rvm_path/help"}"
args=($*)
-command="${args[0]}"
-action="${args[1]}"
-args="$(echo ${args[@]:2}) " # Strip trailing / leading / extra spacing.
-if [[ ! -z "$command" ]] && [[ -s "${rvm_help_path}/${command}" ]] ; then
- if [[ ! -z "$action" ]] && [[ -s "${rvm_help_path}/${command}/${action}" ]] ; then
+command="${args[$__array_start]}"
+args[$__array_start]=""
+args=(${args[@]})
+
+action="${args[$array_start]}"
+args[$__array_start]=""
+args=(${args[@]})
+
+if [[ -n "$command" && -s "${rvm_help_path}/${command}" ]] ; then
+
+ if [[ -n "$action" && -s "${rvm_help_path}/${command}/${action}" ]] ; then
+
less "${rvm_help_path}/${command}/${action}"
+
else
+
less "${rvm_help_path}/${command}"
+
fi
+
else
+
less "${rvm_path:-$HOME/.rvm}/README"
+
"$rvm_path/scripts/log" "info" \
"Commands available with 'rvm help':\n\n $(builtin cd "${rvm_help_path}" ; find . -maxdepth 1 -mindepth 1 -type f -print | \tr "\n" ' ' | sed -e 's#./##g')"
fi
"$rvm_path/scripts/log" "info" \