scripts/cli in rvm-0.0.87 vs scripts/cli in rvm-0.0.88

- old
+ new

@@ -241,26 +241,26 @@ rvm_action="use" rvm_ruby_interpreter="system" rvm_ruby_string="$rvm_token" ;; - --install) rvm_install_on_use_flag=1 ;; - -h|--help|usage|help) rvm_action=help ;; - -G|--gems) rvm_gem_path="$1" ; shift ;; - --source) rvm_src_path="$1" ; shift ;; - --archives) rvm_archives_path="$1" ; shift ;; - --make) rvm_ruby_make="$1" ; shift ;; - --make-install) rvm_ruby_make_install="$1" ; shift ;; - --nice) rvm_niceness="$1" ; shift ;; - -l|--level) rvm_ruby_patch_level="p$1" ; shift ;; + --install) rvm_install_on_use_flag=1 ;; + -h|--help|usage|help) rvm_action=help ;; + -G|--gems) rvm_gem_path="$1" ; shift ;; + --source) rvm_src_path="$1" ; shift ;; + --archives) rvm_archives_path="$1" ; shift ;; + --make) rvm_ruby_make="$1" ; shift ;; + --make-install) rvm_ruby_make_install="$1" ; shift ;; + --nice) rvm_niceness="$1" ; shift ;; + -l|--level) rvm_ruby_patch_level="p$1" ; shift ;; # TODO: handle this below better (if $1 is null) - -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; - --sdk) rvm_sdk="$1" ; shift ;; - --archflags) rvm_archflags="$1" ; shift ;; + -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; + --sdk) rvm_sdk="$1" ; shift ;; + --archflags) rvm_archflags="$1" ; shift ;; - tests|specs) rvm_action="tests" ;; - --trace) eval "rvm_$(echo $rvm_token | sed 's#-##g')_flag=1" ; set -x ;; + tests|specs) rvm_action="tests" ;; + --trace) export rvm_trace_flag=1 ; set -x ;; --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--jit|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose) eval "rvm_$(echo $rvm_token | sed 's#-##g')_flag=1" if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi ;; @@ -333,11 +333,13 @@ if [[ ! -z "$rvm_error_message" ]] ; then __rvm_pushpop ; return 1 ; fi } rvm() { - trap '__rvm_cleanup_variables ; rm -rf "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15 + if [[ -z "$ZSH_VERSION" ]] ; then + trap 'rm -rf "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15 + fi # Check that this is the current version. disk_version=$(cat "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//') if [[ "${rvm_version}" != "${disk_version}" ]] && [[ "reload" != "$1" ]]; then echo -e "A newer version of rvm has been installed ($disk_version) than is loaded ($rvm_version), please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts" @@ -348,11 +350,10 @@ __rvm_load_rvmrc __rvm_initialize __rvm_load_defaults __rvm_parse_args $@ - if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi result=0 case "$rvm_action" in use) __rvm_use ; result=$? ;; gemdir) __rvm_gemdir ; result=$? ;; srcdir) __rvm_source_dir ; result=$? ;; @@ -364,19 +365,27 @@ reboot) __rvm_reboot ; result=$? ;; usage|help) __rvm_usage ; result=$? ;; benchmark) __rvm_benchmark ; result=$? ;; inspect) __rvm_inspect ; result=$? ;; gems) __rvm_gems ; result=$? ;; - remove) __rvm_remove_ruby ; result=$? ;; ruby|gem|rake) __rvm_do ; result=$? ;; monitor) export rvm_ruby_version rvm_ruby_string $rvm_scripts_path/monitor ; result=$? ;; notes) $rvm_scripts_path/notes ; result=$? ;; reload) rvm_reload_flag=1 ;; - fetch|install|uninstall) __rvm_manage_rubies ; result=$? ;; + fetch|install|uninstall|remove) + if [[ ! -z "$rvm_ruby_string" ]] ; then + $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_string" + elif $rvm_scripts_path/match "$rvm_ruby_version" "," ; then + $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_version" + else + $rvm_scripts_path/manage "$rvm_action" + fi + result=$? + ;; tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;; iconv|openssl|ncurses|zlib|readline|curl) __rvm_${rvm_action}_install result=$? @@ -403,10 +412,10 @@ result=1 esac if [[ "$rvm_reload_flag" -eq 1 ]] ; then source "$rvm_path/scripts/rvm" ; fi - if [[ "1" = "$rvm_trace_flag" ]] ; then set +x ; unset rvm_trace_flag ; fi + if [[ "$rvm_trace_flag" -eq 1 ]] ; then set +x ; unset rvm_trace_flag ; fi return $result }