scripts/cli in rvm-0.0.60 vs scripts/cli in rvm-0.0.61

- old
+ new

@@ -3,11 +3,11 @@ function __rvm_meta { rvm_meta_author="Wayne E. Seguin" rvm_meta_author_email="wayneeseguin@gmail.com" rvm_meta_website="http://rvm.beginrescueend.com/" rvm_meta_version="$(cat $rvm_path/lib/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')" - rvm_meta_updated="2009.10.18" + rvm_meta_updated="2009.10.19" } function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; } function __rvm_usage { @@ -105,11 +105,11 @@ function __rvm_parse_args { 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|iconv|gemsync|update) + install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|gemsync|update|iconv|openssl|ncurses|zlib|readline) rvm_action=$rvm_token ;; use) rvm_action=$rvm_token @@ -133,11 +133,11 @@ jruby|ree|macruby|rbx|rubinius|default|all) rvm_ruby_interpreter="$rvm_token" rvm_action="${rvm_action:-use}" #if [ ! -z "$(echo $1 | awk '/^[0-9]/')" ] ; then - if [[ $1 =~ ^[0-9] ]] ; then + if [[ ! -z "$1" ]] && [[ "$1" =~ ^[0-9] ]] ; then rvm_ruby_version=$1 ; shift fi ;; gems|gemset) @@ -179,11 +179,11 @@ fi ;; 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') + rvm_action=$(echo $rvm_token | sed 's#do##g') if [ "rake" = "$rvm_action" -o "$rvm_action" = "gem" -o "$rvm_action" = "ruby" ] ; then if [ -z "$1" ] ; then rvm_action="error" rvm_error_message="the 'ruby' and 'gem' actions must be followed by arguments." @@ -354,15 +354,15 @@ # TODO: handle this below better (if $1 is null) -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; tests|specs) rvm_action="tests" ;; --trace) - eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1" + 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) - eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1" + eval "rvm_$(echo $rvm_token | sed 's#-##g')_flag=1" ;; reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth) $rvm_action="reboot" ;; @@ -374,14 +374,14 @@ *) if [ ! -z "$rvm_token" ] ; then if [ "gems" = "$rvm_action" ] ; then if [ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ] ; then - rvm_file_name="$(echo $rvm_token | sed 's/\.gems//g').gems" + rvm_file_name="$(echo $rvm_token | sed 's#\.gems##g').gems" # elif [ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ] ; then else - rvm_gem_set_name="$(echo $rvm_token | sed 's/\.gems//g')" + rvm_gem_set_name="$(echo $rvm_token | sed 's#\.gems##g')" rvm_file_name="$rvm_gem_set_name.gems" fi elif [ ! -z "$(echo $rvm_token | awk '/,/')" ] ; then rvm_ruby_version="$rvm_token" if [ -z "$rvm_action" ] ; then @@ -389,15 +389,15 @@ fi elif [ ! -z "$(echo $rvm_token | awk '/^.+%.+$/')" ] ; 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 '/^[0-9].[0-9]/')" ] ; then - elif [[ $rvm_token =~ ^[0-9].[0-9] ]] ; then + elif [[ ! -z "$rvm_token" ]] && [[ "$rvm_token" =~ ^[0-9].[0-9] ]] ; then rvm_ruby_string="$rvm_token" else if [ ! -z "$(echo $rvm_token | awk '/\.rb$/{print}')" ] ; then # we have a specified ruby script - #if [[ ! $rvm_token =~ \.rb$ ]] ; then # we have a specified ruby script + #if [[ ! -z "$rvm_token" ]] && [[ " ! $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" # Not sure if we really want to do this but we'll try it out. fi @@ -447,16 +447,20 @@ # TODO: how can we use bin_path here for reload, default file? reload) __rvm_reload ; result=$? ;; implode) __rvm_implode ; result=$? ;; update) __rvm_update ; result=$? ;; readline) __rvm_readline_install ; result=$? ;; - iconv) __rvm_iconv_install ; result=$? ;; reboot) __rvm_reboot ; result=$? ;; usage|help) __rvm_usage ; result=$? ;; benchmark) __rvm_benchmark ; result=$? ;; ruby) __rvm_do ; result=$? ;; inspect) __rvm_inspect ; result=$? ;; gems) __rvm_gems ; result=$? ;; + + iconv|openssl|ncurses|zlib|readline) + __rvm_${rvm_action}_install + result=$? + ;; install|uninstall|remove) __rvm_manage_rubies result=$? ;;