Permalink
Browse files

improving rvm list

  • Loading branch information...
1 parent 30dc04d commit 43f3facdf53473e8f020b0037b177c6b019b5b32 @mpapis mpapis committed Aug 23, 2012
Showing with 26 additions and 21 deletions.
  1. +17 −0 help/list
  2. +3 −1 help/mount
  3. +6 −20 scripts/list
View
@@ -0,0 +1,17 @@
+Show list of available rubies,
+
+## Usage:
+
+ rvm list [help,known,remote,gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags]
+
+## Actions:
+
+- `help` - show this help
+- `known` - list known rubies, that can be installed
+- `remote` - list binary build rubies, they do not need compilation
+- `gemsets` - list all rubies with their gemsets
+- `rubies` - list installed rubies, it is the default action when none given
+- `strings` - list installed rubies, machine passable form
+- `known_strings` - list known rubies, that can be installed, machine passable form
+- `ruby_svn_tags` - list ruby tags available at http://svn.ruby-lang.org/repos/ruby/tags/
+- `default [string]` - show the default ruby, passable form with strings
View
@@ -50,7 +50,9 @@ And finally it is possible to just give a name and RVM will build the path for y
## List of available builds
-- https://rvm.io/binary/ubuntu/12.04/x86_64/ruby-1.9.3-p194.tar.bz2
+RVM automatically detects current platform and displays rubies available for it:
+
+ rvm list remote
## Preparing your own build of ruby
View
@@ -6,17 +6,7 @@ source "$rvm_scripts_path/base"
usage()
{
- printf "%b" "
- Usage:
-
- rvm list [action]
-
- Actions:
-
- {help,known,gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags}
-
-"
-
+ "${rvm_scripts_path}/help" list "$@"
return 0
}
@@ -374,14 +364,7 @@ args=($*)
action="${args[0]:-""}"
args=${args[@]:1} # Strip trailing / leading / extra spacing.
-
-if [[ -z "$action" ]]
-then
- list_rubies
- exit 0
-fi
-
-case "$action" in
+case "${action:-rubies}" in
-r|--remote|remote) list_remote ;;
known) list_known ;;
known_strings) list_known_strings ;;
@@ -391,7 +374,10 @@ case "$action" in
strings) list_strings ;;
ruby_svn_tags) list_ruby_svn_tags ;;
help) usage ;;
- *) usage ; exit 1 ;;
+ *)
+ rvm_error_help "Unknown action '$action' for 'rvm list'." list $action
+ exit 1
+ ;;
esac
exit $?

0 comments on commit 43f3fac

Please sign in to comment.