diff --git a/Library/Homebrew/completions/bash.erb b/Library/Homebrew/completions/bash.erb index 6bab42bbc6..1cdb120743 100644 --- a/Library/Homebrew/completions/bash.erb +++ b/Library/Homebrew/completions/bash.erb @@ -13,6 +13,12 @@ %> # Bash completion script for brew(1) +if test -v POSIXLY_CORRECT || test -o posix +then + echo "Homebrew Bash completions do not work in POSIX mode" 1>&2 + return +fi + __brewcomp_words_include() { local element idx for (( idx = 1; idx < COMP_CWORD; idx++ )) diff --git a/completions/bash/brew b/completions/bash/brew index 1426bf06ff..3b471f6dcc 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -1,5 +1,11 @@ # Bash completion script for brew(1) +if test -v POSIXLY_CORRECT || test -o posix +then + echo "Homebrew Bash completions do not work in POSIX mode" 1>&2 + return +fi + __brewcomp_words_include() { local element idx for (( idx = 1; idx < COMP_CWORD; idx++ ))