scripts/cli in rvm-0.0.49 vs scripts/cli in rvm-0.0.50

- old
+ new

@@ -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|update|readline|iconv|use|gemsync) + install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|use|gemsync|gemset) rvm_action=$rvm_token ;; inspect) rvm_action=$rvm_token @@ -138,10 +138,26 @@ if [ "$1" = "user" ] ; then rvm_ruby_interpreter="user" ; shift ; fi rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}" ;; + --load|load|dump) + 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 + shift + else + rvm_gem_set_name="default" + fi + rvm_file_name="$rvm_gem_set_name.gemset" + rvm_action=$rvm_token + ;; + gemdup) rvm_action=$rvm_token if [ -z "$1" ] ; then rvm_ruby_interpreter="default" elif [ "$1" = "system" ] ; then @@ -295,22 +311,10 @@ rvm_action="ruby" rvm_ruby_args="$@" rvm_parse_break=1 ;; - --load) - rvm_load_flag=1 - if [ ! -z "$1" ] ; then - rvm_load_file="$1" - shift - else - rvm_action="error" - rvm_error_message="--load must be followed by the .gemset file to load." - break; - fi - ;; - default|system) rvm_action="use" rvm_ruby_interpreter="system" ;; @@ -381,13 +385,13 @@ if [ -z "$rvm_trace_flag" ] ; then set +x ; else set -x ; fi result=0 case "$rvm_action" in use) __rvm_use ; result=$? ;; - gemdir) __rvm_gem-dir ; result=$? ;; - gemdup) __rvm_gem-dup ; result=$? ;; - srcdir) __rvm_src-dir ; 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=$? ;; # TODO: how can we use bin_path here for reload, default file? reload) __rvm_reload ; result=$? ;; @@ -402,9 +406,13 @@ inspect) __rvm_inspect ; result=$? ;; install|uninstall|remove) __rvm_manage_rubies result=$? + ;; + + load|dump) + __rvm_gemset_${rvm_action} ;; gemsync) rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home` __rvm_gem_sync