From e69d1b82d8b3762cb422fa6d70ad319d6737e438 Mon Sep 17 00:00:00 2001 From: Kelly Stannard Date: Wed, 3 Oct 2018 10:02:44 -0400 Subject: [PATCH] further bundle exec completion examples: `bundle exec rsp` + TAB => `bundle exec rspec` `bundle exec rspec --no` + TAB => `bundle exec rspec --no-color` --- completion/available/bundler.completion.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/completion/available/bundler.completion.bash b/completion/available/bundler.completion.bash index 274a4a36..cdb7cf54 100644 --- a/completion/available/bundler.completion.bash +++ b/completion/available/bundler.completion.bash @@ -21,6 +21,9 @@ __bundle() { if [[ -z $bundle_command ]]; then options="$options --version --help" fi + elif [[ $bundle_command = "exec" ]]; then + _bundle_exec_completions + return else if [[ -z $bundle_command || $bundle_command = help ]]; then 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 # vim: ai ft=sh sw=4 sts=2 et + +_bundle_exec_completions() +{ + if [[ $COMP_CWORD = 2 ]]; then + COMPREPLY=($(compgen -c -- "$2")) + fi +}