scripts/cli in rvm-0.1.41 vs scripts/cli in rvm-0.1.42
- old
+ new
@@ -20,11 +20,11 @@
if echo "$@" | grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
while [[ $# -gt 0 ]] ; do
rvm_token="$1" ; shift
case "$rvm_token" in
- fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer)
+ fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env)
rvm_action=$rvm_token
;;
package)
rvm_action="$rvm_token"
@@ -39,14 +39,10 @@
rvm_action=$rvm_token
rvm_verbose_flag=1
if [[ "ruby" = "$1" ]] ; then shift ; fi
;;
- env)
- rvm_action=$rvm_token
- ;;
-
install|uninstall)
export ${rvm_token}_flag=1
rvm_action=$rvm_token
;;
@@ -117,26 +113,33 @@
rvm_parse_break=1
;;
-S)
rvm_action="ruby"
- rvm_ruby_args="$rvm_token $@"
+ rvm_ruby_args="$rvm_token $(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
-e)
rvm_action="ruby"
- rvm_ruby_args="$rvm_token \"$@\""
+ rvm_ruby_args="$rvm_token $(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
- exec|cleanup)
+ exec|cleanup|tools|disk-usage)
rvm_action="$rvm_token"
rvm_ruby_args="$(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
+ load-rvmrc)
+ rvm_action="$rvm_token"
+ rvm_ruby_args="$1"
+ rvm_parse_break=1
+ ;;
+
+
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')
if [[ "rake" = "$rvm_action" ]] || [[ "gem" = "$rvm_action" ]] || [[ "ruby" = "$rvm_action" ]] ; then
if [[ -z "$1" ]] ; then
@@ -152,18 +155,18 @@
rvm_error_message="rvm X,Y,Z '$rvm_action' must be followed by arguments."
fi
fi
elif [[ "-S" = "$1" ]] ; then
rvm_action="ruby"
- rvm_ruby_args="$flag $@"
+ rvm_ruby_args="$flag $(__rvm_quote_args "$@")"
rvm_parse_break=1
elif [[ "-e" = "$1" ]] ; then
rvm_action="ruby"
- rvm_ruby_args="$flag '$@'"
+ rvm_ruby_args="$flag $(__rvm_quote_args "$@")"
rvm_parse_break=1
else
- rvm_ruby_args="$*"
+ rvm_ruby_args="$(__rvm_quote_args "$@")"
rvm_parse_break=1
fi
else
if $rvm_scripts_path/match "$1" "^-" ; then
unset rvm_ruby_strings
@@ -316,10 +319,16 @@
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--rvmrc|--gems|--docs)
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
;;
+ --clang)
+ export rvm_clang_flag=1
+ export rvm_prior_cc="$CC"
+ export CC="clang"
+ ;;
+
-j)
if [[ ! -z "$1" ]] ; then
rvm_make_flags="$rvm_make_flags -j$1"
shift
else
@@ -380,10 +389,15 @@
elif [[ ! -z "$(echo "$rvm_token" | awk '/,/')" ]] ; then
rvm_ruby_strings="$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 $rvm_scripts_path/match "$rvm_token" "^${rvm_gemset_separator}" ; then
+ rvm_action="use"
+ rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
+ rvm_ruby_string="$(__rvm_environment_identifier | awk -F${rvm_gemset_separator} '{print $1}')"
+ rvm_ruby_strings="${rvm_ruby_string}${rvm_gemset_separator}${rvm_gemset_name}"
elif $rvm_scripts_path/match "$rvm_token" "^.+${rvm_gemset_separator}.+$" ; then
rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
rvm_ruby_string="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $1}')"
rvm_ruby_strings="$rvm_token"
elif $rvm_scripts_path/match "$rvm_token" "-" ; then
@@ -450,11 +464,11 @@
__rvm_cleanup_variables
__rvm_load_rvmrc
__rvm_initialize
__rvm_parse_args "$@"
- export BUNDLE_PATH GEM_HOME GEM_PATH rvm_ruby_string rvm_action rvm_bin_flag rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_file_name rvm_gemset_name rvm_head_flag rvm_install_on_use_flag rvm_interactive rvm_llvm_flag rvm_make_flags rvm_proxy rvm_remove_flag rvm_ruby_args rvm_ruby_configure_flags rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_name rvm_ruby_version rvm_system_flag rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_patch_names rvm_patch_original_pwd
+ export BUNDLE_PATH GEM_HOME GEM_PATH rvm_ruby_string rvm_action rvm_bin_flag rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_file_name rvm_gemset_name rvm_head_flag rvm_install_on_use_flag rvm_interactive rvm_llvm_flag rvm_make_flags rvm_proxy rvm_remove_flag rvm_ruby_args rvm_ruby_configure_flags rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_name rvm_ruby_version rvm_system_flag rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_patch_names rvm_patch_original_pwd rvm_clang_flag
export rvm_path rvm_rubies_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_patches_path rvm_patches_path rvm_patchsets_path rvm_log_path rvm_bin_path rvm_gems_path rvm_config_path rvm_tmp_path rvm_hooks_path rvm_gems_cache_path rvm_gemset_separator
result=0
case "$rvm_action" in
use) __rvm_use ; result=$? ;;
@@ -519,10 +533,26 @@
cleanup)
eval "$rvm_scripts_path/cleanup $rvm_ruby_args"
result=$?
;;
+ tools)
+ eval "$rvm_scripts_path/tools $rvm_ruby_args"
+ result=$?
+ ;;
+
+ disk-usage)
+ eval "$rvm_scripts_path/disk-usage $rvm_ruby_args"
+ result=$?
+ ;;
+
+
+ load-rvmrc)
+ __rvm_project_rvmrc "$rvm_ruby_args"
+ result=$?
+ ;;
+
gemset)
#if $rvm_scripts_path/match $rvm_ruby_args use ; then
if [[ "$rvm_use_flag" -eq 1 ]] ; then
__rvm_gemset_select
result=$? ; if [[ $result -eq 0 ]] ; then
@@ -551,16 +581,16 @@
monitor)
export rvm_ruby_strings rvm_ruby_string
$rvm_scripts_path/monitor ; result=$?
;;
notes) $rvm_scripts_path/notes ; result=$? ;;
- reload) unset rvm_loaded_flag ; rvm_reload_flag=1 ;;
+ reload) unset rvm_loaded_flag ; rvm_reload_flag=1 ;;
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_strings" "," ; then
+ if [[ -n "$rvm_ruby_strings" ]] && $rvm_scripts_path/match "$rvm_ruby_strings" "," ; then
$rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_strings"
+ elif [[ -n "$rvm_ruby_string" ]]; then
+ $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_string"
else
$rvm_scripts_path/manage "$rvm_action"
fi
result=$?
;;