scripts/cli in rvm-0.0.80 vs scripts/cli in rvm-0.0.81

- old
+ new

@@ -15,11 +15,11 @@ if [[ ! -z "$(echo "$*" | awk '/trace/')" ]] ; then echo "$*" ; fi while [[ $# -gt 0 ]] ; do rvm_token="$1" ; shift case "$rvm_token" in - install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|gemsync|update|iconv|curl|openssl|ncurses|zlib|readline) + install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline) rvm_action=$rvm_token ;; use) rvm_action=$rvm_token @@ -45,11 +45,11 @@ jruby|ree|macruby|rbx|rubinius|mput|shyouhei|default|all) rvm_ruby_interpreter="$rvm_token" rvm_ruby_string="$rvm_token" rvm_action="${rvm_action:-use}" - if match "$1" "^[0-9]\.[0-9]" ; then rvm_ruby_version=$1 ; shift ; fi + if $rvm_scripts_path/match "$1" "^[0-9]\.[0-9]" ; then rvm_ruby_version=$1 ; shift ; fi ;; gems|gemset) rvm_action="gems" if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "delete" = "$1" ]] ; then @@ -70,26 +70,10 @@ --load|load|dump|clear) rvm_action="gems" eval "rvm_${rvm_token}_flag=1" ;; - gemdup) - rvm_action=$rvm_token - if [[ -z "$1" ]] ; then - rvm_ruby_interpreter="default" - elif [[ "system" = "$1" ]] ; then - rvm_ruby_interpreter=$1 ; shift - elif [[ "user" = "$1" ]] ; then - rvm_ruby_interpreter=$1 ; shift - elif [[ "default" = "$1" ]] ; then - rvm_ruby_interpreter=$1 ; shift - else - rvm_ruby_interpreter=$1 ; shift - rvm_ruby_version=$2 ; shift - fi - ;; - -S|-e) rvm_action="ruby" rvm_ruby_args="$rvm_token $@" rvm_parse_break=1 ;; @@ -111,14 +95,14 @@ else rvm_ruby_args="$*" rvm_parse_break=1 fi else - if match "$1" "^-" ; then + if $rvm_scripts_path/match "$1" "^-" ; then unset rvm_ruby_version else - if match "$1" "^[0-9]" ; then + if $rvm_scripts_path/match "$1" "^[0-9]" ; then rvm_ruby_version=$(echo "$1" | tr ',' ' ') ; shift unset rvm_ruby_interpreter else if [[ "jruby" = "$1" ]] || [[ "rbx" = "$1" ]] || [[ "rubinius" = "$1" ]] || [[ "macruby" = "$1" ]] || [[ "ree" = "$1" ]] || [[ "mput" = "$1" ]] || [[ "shyouhei" = "$1" ]] ; then rvm_ruby_interpreter=$1 ; shift @@ -246,11 +230,10 @@ rvm_ruby_string="$rvm_token" ;; --install) rvm_install_on_use_flag=1 ;; -h|--help|usage|help) rvm_action=help ;; - --prefix) rvm_prefix_path="$1" ; shift ;; -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 ;; @@ -264,10 +247,11 @@ tests|specs) rvm_action="tests" ;; --trace) eval "rvm_$(echo $rvm_token | sed 's#-##g')_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 ;; reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth) $rvm_action="reboot" ;; @@ -278,11 +262,11 @@ ;; *) if [[ ! -z "$rvm_token" ]] ; then if [[ "gems" = "$rvm_action" ]] ; then - if match "$rvm_token" "^.+%.+$" ; then + if $rvm_scripts_path/match "$rvm_token" "^.+%.+$" ; then rvm_gem_set_name="$(echo "$rvm_token" | awk -F'%' '{print $2}')" rvm_ruby_string="$(echo "$rvm_token" | awk -F'%' '{print $1}')" elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then rvm_file_name="$(echo "$rvm_token" | sed 's#\.gems##g').gems" # elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then @@ -293,23 +277,23 @@ elif [[ ! -z "$(echo "$rvm_token" | awk '/,/')" ]] ; then rvm_ruby_version="$rvm_token" if [[ -z "$rvm_action" ]] ; then rvm_action="ruby" # Not sure if we really want to do this but we'll try it out. fi - elif match "$rvm_token" "^.+%.+$" ; then + elif $rvm_scripts_path/match "$rvm_token" "^.+%.+$" ; then rvm_gem_set_name="$(echo "$rvm_token" | awk -F'%' '{print $2}')" rvm_ruby_string="$(echo "$rvm_token" | awk -F'%' '{print $1}')" - elif match "$rvm_token" "-" ; then + elif $rvm_scripts_path/match "$rvm_token" "-" ; then rvm_ruby_string="$rvm_token" - elif match "$rvm_token" "^[0-9].[0-9]" ; then + elif $rvm_scripts_path/match "$rvm_token" "^[0-9].[0-9]" ; then rvm_ruby_string="$rvm_token" rvm_action="${rvm_action:-use}" - elif match "$rvm_token" "^ree" ; then + elif $rvm_scripts_path/match "$rvm_token" "^ree" ; then rvm_ruby_string="$rvm_token" rvm_action="${rvm_action:-use}" else - if match "$rvm_token" "\.rb$" ; then # we have a specified ruby script + if $rvm_scripts_path/match "$rvm_token" "\.rb$" ; then # we have a specified ruby script rvm_ruby_args=$rvm_token rvm_ruby_file=$rvm_token if [[ -z "$rvm_action" ]] ; then rvm_action="ruby" fi @@ -334,11 +318,10 @@ 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 # 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 @@ -355,11 +338,10 @@ 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=$? ;; - gemdup) __rvm_gemdup ; result=$? ;; srcdir) __rvm_source_dir ; result=$? ;; list) __rvm_list ; result=$? ;; version) __rvm_version ; result=$? ;; reset) __rvm_reset ; result=$? ;; implode) __rvm_implode ; result=$? ;; @@ -379,29 +361,24 @@ iconv|openssl|ncurses|zlib|readline|curl) __rvm_${rvm_action}_install result=$? ;; - gemsync) - rvm_source_gem_path=$(__rvm_select ; echo $rvm_ruby_gem_home) - __rvm_gem_sync - ;; - info|debug) __rvm_version __rvm_info if [[ "debug" = "$rvm_action" ]] ; then rvm_debug_flag=1 ; __rvm_debug ; fi ;; error) - __rvm_log "fail" "$rvm_error_message ( see: 'rvm usage' )" + $rvm_scripts_path/log "fail" "$rvm_error_message ( see: 'rvm usage' )" __rvm_pushpop result=1; ;; *) if [[ ! -z "$rvm_action" ]] ; then - __rvm_log "fail" "unknown action '$rvm_action'" + $rvm_scripts_path/log "fail" "unknown action '$rvm_action'" else __rvm_usage fi result=1 esac