Add --bare option to rbenv-versions

This commit is contained in:
Sam Stephenson 2011-08-02 23:19:37 -05:00
parent 86362408f1
commit 652135db7f

View file

@ -2,14 +2,22 @@
RBENV_VERSION="$(rbenv-version)" RBENV_VERSION="$(rbenv-version)"
for path in ~/.rbenv/versions/*; do hit_prefix="* "
miss_prefix=" "
if [ "$1" = "--bare" ]; then
hit_prefix=""
miss_prefix=""
fi
for path in "${HOME}/.rbenv/versions/"*; do
if [ -d "$path" ]; then if [ -d "$path" ]; then
version="${path##*/}" version="${path##*/}"
if [ "$version" == "$RBENV_VERSION" ]; then if [ "$version" == "$RBENV_VERSION" ]; then
echo "* $version" echo "${hit_prefix}${version}"
else else
echo " $version" echo "${miss_prefix}${version}"
fi fi
fi fi
done done