Bash completions: warn and exit if POSIX mode detected

This commit is contained in:
Maxim Belkin 2023-02-16 15:57:37 +00:00
parent c9fdce3e3c
commit 216ad265af
2 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,12 @@
%> %>
# Bash completion script for brew(1) # 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() { __brewcomp_words_include() {
local element idx local element idx
for (( idx = 1; idx < COMP_CWORD; idx++ )) for (( idx = 1; idx < COMP_CWORD; idx++ ))

View File

@ -1,5 +1,11 @@
# Bash completion script for brew(1) # 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() { __brewcomp_words_include() {
local element idx local element idx
for (( idx = 1; idx < COMP_CWORD; idx++ )) for (( idx = 1; idx < COMP_CWORD; idx++ ))