source "$rvm_scripts_path/base" usage() { echo "Usage: rvm tools {identifier,path-identifier}" 1>&2 exit 1 } # Return the identifier that's current in use. tools_identifier() { __rvm_environment_identifier } tools_path_identifier() { if [[ -z "$1" || ! -d "$1" ]]; then echo "Usage: rvm tools path-identifier 'path-to-heck'" return 1 fi # Change to the directory. Do in subshell to keep the env correct. (source $rvm_scripts_path/rvm cd "$1" >/dev/null 2>&1 __rvm_environment_identifier) } [[ -z "$1" ]] && usage action="$1"; shift case "$action" in identifier) tools_identifier ;; path-identifier) tools_path_identifier "$@" ;; *) usage ;; esac exit $?