Extract rbenv-shims

This commit is contained in:
Sam Stephenson 2011-09-13 12:55:19 -05:00
parent 69d596f56f
commit 61830048d5
2 changed files with 18 additions and 4 deletions

View file

@ -4,10 +4,7 @@ set -e
# Provide rbenv completions # Provide rbenv completions
if [ "$1" = "--complete" ]; then if [ "$1" = "--complete" ]; then
for command in "${RBENV_ROOT}/shims/"*; do exec rbenv shims --short
echo "${command##*/}"
done
exit
fi fi
RBENV_COMMAND="$1" RBENV_COMMAND="$1"

17
libexec/rbenv-shims Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x
# Provide rbenv completions
if [ "$1" = "--complete" ]; then
echo --short
exit
fi
for command in "${RBENV_ROOT}/shims/"*; do
if [ "$1" = "--short" ]; then
echo "${command##*/}"
else
echo "$command"
fi
done | sort