Created
May 24, 2011 21:30
-
-
Save betawaffle/989747 to your computer and use it in GitHub Desktop.
Easy Switch RVM Completions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ruby18='ruby-1.8.7-p334' | |
local ruby19='ruby-1.9.2-p180' | |
function rb18 { | |
if [ -z "$1" ]; then | |
rvm use "$ruby18" | |
else | |
rvm use "$ruby18@$1" | |
fi | |
} | |
_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} | |
compdef _rb18 rb18 | |
function rb19 { | |
if [ -z "$1" ]; then | |
rvm use "$ruby19" | |
else | |
rvm use "$ruby19@$1" | |
fi | |
} | |
_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} | |
compdef _rb19 rb19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment