scripts/cli in rvm-0.1.42 vs scripts/cli in rvm-0.1.43
- old
+ new
@@ -8,10 +8,16 @@
#else
#cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less}
#fi
#}
+__rvm_run_script() {
+ local rvm_script_name="${1:-"$rvm_action"}"
+ eval "$rvm_scripts_path/$rvm_script_name $rvm_ruby_args"
+ return $?
+}
+
__rvm_parse_args() {
# TODO:
# Make this more robust '__rvm_history' so that it stores *unique* rvm commands.
# Otherwise this file gets big rather fast.
@@ -42,10 +48,11 @@
;;
install|uninstall)
export ${rvm_token}_flag=1
rvm_action=$rvm_token
+ export rvm_install_arguments="$(__rvm_quote_args_with_shift 1 "$@")"
;;
rm|remove)
rvm_action="remove"
rvm_remove_flag=1
@@ -123,11 +130,11 @@
rvm_action="ruby"
rvm_ruby_args="$rvm_token $(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
- exec|cleanup|tools|disk-usage)
+ exec|cleanup|tools|disk-usage|snapshot)
rvm_action="$rvm_token"
rvm_ruby_args="$(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
@@ -135,11 +142,10 @@
rvm_action="$rvm_token"
rvm_ruby_args="$1"
rvm_parse_break=1
;;
-
do|ruby|rake|gem|rubydo|rakedo|gemdo)
if [[ "do" = "$rvm_action" ]] ; then rvm_action="ruby" ; fi
rvm_action=$(echo $rvm_token | sed 's#do##g')
if [[ "rake" = "$rvm_action" ]] || [[ "gem" = "$rvm_action" ]] || [[ "ruby" = "$rvm_action" ]] ; then
if [[ -z "$1" ]] ; then
@@ -464,11 +470,11 @@
__rvm_cleanup_variables
__rvm_load_rvmrc
__rvm_initialize
__rvm_parse_args "$@"
- export BUNDLE_PATH GEM_HOME GEM_PATH rvm_ruby_string rvm_action rvm_bin_flag rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_file_name rvm_gemset_name rvm_head_flag rvm_install_on_use_flag rvm_interactive rvm_llvm_flag rvm_make_flags rvm_proxy rvm_remove_flag rvm_ruby_args rvm_ruby_configure_flags rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_name rvm_ruby_version rvm_system_flag rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_patch_names rvm_patch_original_pwd rvm_clang_flag
+ export BUNDLE_PATH GEM_HOME GEM_PATH rvm_ruby_string rvm_action rvm_bin_flag rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_file_name rvm_gemset_name rvm_head_flag rvm_install_on_use_flag rvm_interactive rvm_llvm_flag rvm_make_flags rvm_proxy rvm_remove_flag rvm_ruby_args rvm_ruby_configure_flags rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_name rvm_ruby_version rvm_system_flag rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_patch_names rvm_patch_original_pwd rvm_clang_flag rvm_install_arguments
export rvm_path rvm_rubies_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_patches_path rvm_patches_path rvm_patchsets_path rvm_log_path rvm_bin_path rvm_gems_path rvm_config_path rvm_tmp_path rvm_hooks_path rvm_gems_cache_path rvm_gemset_separator
result=0
case "$rvm_action" in
use) __rvm_use ; result=$? ;;
@@ -528,26 +534,16 @@
# Restore the state pre-sets.
[[ -n "$old_rvm_ruby_string" ]] && rvm_ruby_string=$old_rvm_ruby_string
unset old_rvm_ruby_string
;;
- cleanup)
- eval "$rvm_scripts_path/cleanup $rvm_ruby_args"
+ cleanup|tools|snapshot|disk-usage)
+ __rvm_run_script "$rvm_action"
result=$?
;;
- tools)
- eval "$rvm_scripts_path/tools $rvm_ruby_args"
- result=$?
- ;;
- disk-usage)
- eval "$rvm_scripts_path/disk-usage $rvm_ruby_args"
- result=$?
- ;;
-
-
load-rvmrc)
__rvm_project_rvmrc "$rvm_ruby_args"
result=$?
;;
@@ -618,10 +614,10 @@
esac
if [[ ! -z "$rvm_reload_flag" ]] ; then
source "$rvm_scripts_path/rvm"
# Note: Not using builtin on purpose. Done so we can trigger a reload the rvmrc.
- cd .
+ __rvm_project_rvmrc
fi
if [[ ! -z "$rvm_trace_flag" ]] ; then set +x ; unset rvm_trace_flag ; fi
__rvm_teardown