diff --git a/ocaml/xe-cli/bash-completion b/ocaml/xe-cli/bash-completion index 0da9be29c0e..0c29a5446b9 100644 --- a/ocaml/xe-cli/bash-completion +++ b/ocaml/xe-cli/bash-completion @@ -814,15 +814,14 @@ set_completions() if [[ $REQD_OPTIONAL_PARAMS == 1 ]]; then local reqd_params=$( __preprocess_suggestions "$REQD_PARAMS" ) local opt_params=$( __preprocess_suggestions "$OPT_PARAMS" ) + if [[ "$excludes" ]]; then + reqd_params=$(echo "$reqd_params" | eval "grep -v $excludes") + opt_params=$(echo "$opt_params" | eval "grep -v $excludes") + fi if [[ "$reqd_params" && "$opt_params" ]]; then __xe_debug "showing optional/required parameters" SHOW_DESCRIPTION=1 - if [[ "$excludes" ]]; then - reqd_params=$(echo "$reqd_params" | eval "grep -v $excludes") - opt_params=$(echo "$opt_params" | eval "grep -v $excludes") - fi - for word in $reqd_params; do __add_completion "$word" "REQUIRED" "$max_cmd_length" done