scripts/cli in rvm-0.0.99 vs scripts/cli in rvm-0.0.999
- old
+ new
@@ -1,20 +1,11 @@
#!/usr/bin/env bash
-__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="${rvm_version}"
-}
-
-__rvm_version() { __rvm_meta ; echo -e "\nrvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]\n" ; }
-
__rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
__rvm_parse_args() {
- if echo "$*" | grep -q 'trace' ; then echo "$*" ; fi
+ if echo "$*" | grep -q 'trace' ; then echo "$*" ; __rvm_version ; fi
while [[ $# -gt 0 ]] ; do
rvm_token="$1" ; shift
case "$rvm_token" in
fetch|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor|notes)
@@ -56,12 +47,27 @@
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" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] ; then
+ if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] ; then
rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
+ elif [[ "clear" = "$1" ]] ; then
+ unset rvm_gem_set_name ; shift
+ export rvm_ruby_gem_home="$(echo $GEM_HOME | sed 's/%.*$//')"
+ export GEM_HOME="$rvm_ruby_gem_home"
+ export GEM_PATH="$GEM_HOME"
+ rvm_ruby_args="clear"
+ rvm_parse_break=1
+ elif [[ "delete" = "$1" ]] ; then
+ export rvm_delete_flag=1 ; shift
+ rvm_ruby_args="$*"
+ rvm_gem_set_name="$1"; shift
+ rvm_ruby_string=$(echo $rvm_gem_set_name | sed 's/\(.*\)%.*/\1/')
+ rvm_gem_set_name=$(echo $rvm_gem_set_name | sed 's/.*%\(.*\)/\1/')
+ if [[ "$rvm_ruby_string" != "$rvm_gem_set_name" ]] ; then export rvm_ruby_string ; fi
+ if [[ ! -z "$rvm_gem_set_name" ]] ; then export rvm_gem_set_name ; fi
else
rvm_gem_set_name="$1" ; shift
export rvm_use_flag=1 # Default is to use the (named) gem set.
fi
;;
@@ -243,11 +249,11 @@
shift
;;
default|system)
rvm_action="use"
- rvm_ruby_interpreter="system"
+ rvm_ruby_interpreter="$rvm_token"
rvm_ruby_string="$rvm_token"
;;
--install) export rvm_install_on_use_flag=1 ;;
-h|--help|usage|help) rvm_action=help ;;
@@ -260,15 +266,14 @@
-l|--level) rvm_ruby_patch_level="p$1" ; shift ;;
# TODO: handle this below better (if $1 is null)
-m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
--sdk) rvm_sdk="$1" ; shift ;;
--archflags) rvm_archflags="$1" ; shift ;;
-
- tests|specs) rvm_action="tests" ;;
--trace) export rvm_trace_flag=1 ; set -x ;;
--symlink) rvm_symlink_name="$1" ; shift ;;
- --disable-llvm|--disable-jit) export rvm_jit_flag=0 ;;
- --enable-llvm|--enable-jit) export rvm_jit_flag=1 ;;
+ tests|specs) rvm_action="tests" ;;
+ --disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
+ --enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--load|--passenger|--editor)
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi
;;