further bundle exec completion

examples:
`bundle exec rsp` + TAB => `bundle exec rspec`
`bundle exec rspec --no` + TAB => `bundle exec rspec --no-color`
pull/1238/head
Kelly Stannard 2018-10-03 10:02:44 -04:00 committed by GitHub
parent 36345cb289
commit e69d1b82d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,9 @@ __bundle() {
if [[ -z $bundle_command ]]; then if [[ -z $bundle_command ]]; then
options="$options --version --help" options="$options --version --help"
fi fi
elif [[ $bundle_command = "exec" ]]; then
_bundle_exec_completions
return
else else
if [[ -z $bundle_command || $bundle_command = help ]]; then if [[ -z $bundle_command || $bundle_command = help ]]; then
options="help install update package exec config check list show options="help install update package exec config check list show
@ -53,3 +56,10 @@ __bundle_get_command() {
complete -F __bundle -o bashdefault -o default bundle complete -F __bundle -o bashdefault -o default bundle
# vim: ai ft=sh sw=4 sts=2 et # vim: ai ft=sh sw=4 sts=2 et
_bundle_exec_completions()
{
if [[ $COMP_CWORD = 2 ]]; then
COMPREPLY=($(compgen -c -- "$2"))
fi
}