From 652135db7fc64377b6c0eef0e50ad1c7d8924553 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 2 Aug 2011 23:19:37 -0500 Subject: [PATCH] Add --bare option to rbenv-versions --- libexec/rbenv-versions | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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