소스 검색

Pull in @telemachus' Bash autocompletion defintion from https://gist.github.com/1122379

pull/360/head^2
Sam Stephenson 13 년 전
부모
커밋
2099355ad5
1개의 변경된 파일41개의 추가작업 그리고 0개의 파일을 삭제
  1. +41
    -0
      completions/rbenv.bash

+ 41
- 0
completions/rbenv.bash 파일 보기

@ -0,0 +1,41 @@
_commands()
{
local cur commands
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
commands="exec prefix rehash set-default set-local version versions\
whence which"
COMPREPLY=( $( compgen -W "${commands}" -- ${cur} ) )
}
_rubies()
{
local cur rubies
local ROOT=$HOME/.rbenv/versions
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
rubies=($ROOT/*)
# remove all but the final part of the name
rubies="${rubies[@]##*/}"
COMPREPLY=( $( compgen -W "${rubies}" -- ${cur} ) )
}
_rbenv()
{
local cur prev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ "${prev}" == set-default ]]; then
_rubies
else
_commands
fi
}
complete -F _rbenv rbenv
# vim: set ts=4 sw=4 tw=75 filetype=sh:

불러오는 중...
취소
저장