pyenv/libexec/rbenv-commands

27 lines
452 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -e
2011-08-03 22:20:01 -05:00
2011-08-23 11:34:03 -05:00
if [ "$1" = "--sh" ]; then
sh=1
shift
fi
2011-08-03 22:20:01 -05:00
shopt -s nullglob
{ for path in ${PATH//:/$'\n'}; do
for command in "${path}/rbenv-"*; do
2011-08-23 11:34:03 -05:00
command="${command##*rbenv-}"
if [ -n "$sh" ]; then
if [ ${command:0:3} = "sh-" ]; then
echo ${command##sh-}
fi
else
if [ ${command:0:3} != "sh-" ]; then
echo $command
fi
fi
2011-08-03 22:20:01 -05:00
done
done
} | sort | uniq