From ecc7ea6969f495619e3382e711370736692b7b6a Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Fri, 3 Jun 2016 12:43:20 -0400 Subject: [PATCH] Show both commands and 'required flags' instead of only 'required flags' --- bash_completions.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bash_completions.go b/bash_completions.go index 3f33bb0..716146f 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -116,12 +116,12 @@ __handle_reply() fi local completions - if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then - completions=("${must_have_one_flag[@]}") - elif [[ ${#must_have_one_noun[@]} -ne 0 ]]; then + completions=("${commands[@]}") + if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then completions=("${must_have_one_noun[@]}") - else - completions=("${commands[@]}") + fi + if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then + completions+=("${must_have_one_flag[@]}") fi COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )