mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #822 from jasonkarns/completion
Add --help and tab completion to rbenv-versions
This commit is contained in:
commit
5fb9c84e14
4 changed files with 22 additions and 2 deletions
|
@ -10,6 +10,11 @@ if [ -z "$COMMAND" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Provide rbenv completions
|
||||
if [ "$COMMAND" = "--complete" ]; then
|
||||
exec rbenv-commands
|
||||
fi
|
||||
|
||||
COMMAND_PATH="$(command -v "rbenv-$COMMAND" || command -v "rbenv-sh-$COMMAND")"
|
||||
|
||||
# --help is provided automatically
|
||||
|
|
|
@ -18,8 +18,7 @@ set -e
|
|||
# Provide rbenv completions
|
||||
if [ "$1" = "--complete" ]; then
|
||||
echo --usage
|
||||
rbenv-commands
|
||||
exit
|
||||
exec rbenv-commands
|
||||
fi
|
||||
|
||||
command_path() {
|
||||
|
|
|
@ -5,6 +5,17 @@
|
|||
set -e
|
||||
[ -n "$RBENV_DEBUG" ] && set -x
|
||||
|
||||
# Provide rbenv completions
|
||||
if [ "$1" = "--complete" ]; then
|
||||
echo -
|
||||
echo --no-rehash
|
||||
echo bash
|
||||
echo fish
|
||||
echo ksh
|
||||
echo zsh
|
||||
exit
|
||||
fi
|
||||
|
||||
print=""
|
||||
no_rehash=""
|
||||
for args in "$@"
|
||||
|
|
|
@ -9,8 +9,13 @@ set -e
|
|||
|
||||
unset bare
|
||||
unset skip_aliases
|
||||
# Provide rbenv completions
|
||||
for arg; do
|
||||
case "$arg" in
|
||||
--complete )
|
||||
echo --bare
|
||||
echo --skip-aliases
|
||||
exit ;;
|
||||
--bare ) bare=1 ;;
|
||||
--skip-aliases ) skip_aliases=1 ;;
|
||||
* )
|
||||
|
|
Loading…
Reference in a new issue