From 4923838981ae57c3d70fef988c3d2db9f70279b3 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 13 Sep 2011 12:46:06 -0500 Subject: [PATCH] Completion for exec --- libexec/rbenv-exec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexec/rbenv-exec b/libexec/rbenv-exec index 6d6ad1eb..d53065fa 100755 --- a/libexec/rbenv-exec +++ b/libexec/rbenv-exec @@ -2,6 +2,14 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x +# Provide rbenv completions +if [ "$1" = "--complete" ]; then + for command in "${RBENV_ROOT}/shims/"*; do + echo "${command##*/}" + done + exit +fi + RBENV_COMMAND="$1" if [ -z "$RBENV_COMMAND" ]; then echo "usage: rbenv exec COMMAND [arg1 arg2...]" >&2