scripts/cli in rvm-0.0.53 vs scripts/cli in rvm-0.0.54

- old
+ new

@@ -105,14 +105,19 @@ 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|update|readline|iconv|use|gemsync|gemset) + install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|gemsync) rvm_action=$rvm_token ;; + use) + rvm_action=$rvm_token + if [ "$1" = "ruby" ] ; then shift ; fi + ;; + inspect) rvm_action=$rvm_token rvm_ruby_args=$* rvm_parse_break=1 ;; @@ -129,33 +134,44 @@ jruby|ree|macruby|rbx|rubinius|default|all) rvm_ruby_interpreter="$rvm_token" rvm_action="${rvm_action:-use}" ;; - gemdir) + gemset) + set +x rvm_action=$rvm_token + if [ "$1" = "delete" ] ; then + rvm_delete_flag=1 + shift + if [ -z "$1" -a -z "$rvm_gem_set_name" ] ; then + rvm_action="error" + rvm_error_message="A gem set name must be specified with 'gemset delete'" + else + rvm_gem_set_name="$1" + shift + fi + fi + set -x + ;; + gemdir) + rvm_action=$rvm_token if [ "$1" = "system" ] ; then rvm_ruby_interpreter="system" ; shift ; fi if [ "$1" = "user" ] ; then rvm_ruby_interpreter="user" ; shift ; fi - rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}" ;; --load|load|dump) + rvm_action=gemset eval "rvm_${rvm_token}_flag=1" if [ ! -z "$1" ] ; then - if [ ! -z "$(echo $1 | awk '/\.gemset$/')" ] ; then - rvm_gem_set_name=$(echo $1 | sed 's/\.gemset//') - else - rvm_gem_set_name=$1 - fi + rvm_gem_set_name=$(echo $1 | sed 's/\.gemset//' | xargs basename) + rvm_file_name="$(echo $1 | sed 's/\.gemset//').gemset" shift else - rvm_gem_set_name="default" + rvm_file_name="$rvm_gem_set_name.gemset" fi - rvm_file_name="$rvm_gem_set_name.gemset" - rvm_action=$rvm_token ;; gemdup) rvm_action=$rvm_token if [ -z "$1" ] ; then @@ -211,13 +227,19 @@ rvm_ruby_interpreter=${rvm_ruby_interpreter:-ruby} rvm_ruby_version="$rvm_token" rvm_action=${rvm_action:-use} ;; - 1.2.0|1.3.1) + 1.2.0|1.3|1.3.0|1.3.1|1.4|1.4.0) + if [ "$rvm_token" = "1.3" ] ; then + rvm_ruby_version="1.3.1" + elif [ "$rvm_token" = "1.4" ] ; then + rvm_ruby_version="1.4.0" + else + rvm_ruby_version="$rvm_token" + fi rvm_ruby_interpreter=${rvm_ruby_interpreter:-jruby} - rvm_ruby_version="$rvm_token" rvm_action=${rvm_action:-use} ;; -v|--version) if [ -z "$1" ] ; then @@ -226,10 +248,14 @@ rvm_ruby_version="$1" shift fi ;; + --repository|--repo|--url) + rvm_ruby_repo_url=$rvm_token + ;; + -t|--tag) rvm_ruby_tag="$1"; rvm_action="${rvm_action:-use}" shift ;; @@ -330,11 +356,11 @@ -h|--help|usage|help) rvm_action=help ; shift ;; -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; --rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;; tests|specs) rvm_action="tests" ;; - --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--jit|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--trace) + --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--jit|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--trace|--delete) eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1" ;; reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth) $rvm_action="reboot" @@ -408,11 +434,20 @@ install|uninstall|remove) __rvm_manage_rubies result=$? ;; - load|dump) - __rvm_gemset_${rvm_action} + gemset) + if [ ! -z "$rvm_load_flag" ] ; then + __rvm_gemset_load + elif [ ! -z "$rvm_dump_flag" ] ; then + __rvm_gemset_load + elif [ ! -z "$rvm_delete_flag" ] ; then + __rvm_gemset_delete + else + rvm_action="error" + rvm_error_message="At least one of load, dump, or delete must be specified with 'gemset'." + fi ;; gemsync) rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home` __rvm_gem_sync