浏览代码

Merge pull request #822 from jasonkarns/completion

Add --help and tab completion to rbenv-versions
pull/487/head^2
Mislav Marohnić 8 年前
父节点
当前提交
5fb9c84e14
共有 4 个文件被更改,包括 22 次插入2 次删除
  1. +5
    -0
      libexec/rbenv-completions
  2. +1
    -2
      libexec/rbenv-help
  3. +11
    -0
      libexec/rbenv-init
  4. +5
    -0
      libexec/rbenv-versions

+ 5
- 0
libexec/rbenv-completions 查看文件

@ -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

+ 1
- 2
libexec/rbenv-help 查看文件

@ -18,8 +18,7 @@ set -e
# Provide rbenv completions
if [ "$1" = "--complete" ]; then
echo --usage
rbenv-commands
exit
exec rbenv-commands
fi
command_path() {

+ 11
- 0
libexec/rbenv-init 查看文件

@ -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 "$@"

+ 5
- 0
libexec/rbenv-versions 查看文件

@ -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 ;;
* )

正在加载...
取消
保存