diff --git a/libexec/rbenv-versions b/libexec/rbenv-versions index 6b848c07..e69c751f 100755 --- a/libexec/rbenv-versions +++ b/libexec/rbenv-versions @@ -2,14 +2,22 @@ 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 version="${path##*/}" if [ "$version" == "$RBENV_VERSION" ]; then - echo "* $version" + echo "${hit_prefix}${version}" else - echo " $version" + echo "${miss_prefix}${version}" fi fi done