completion/system: give up hope
Give up and accept defeat that bash-completion can't reasonably be audited for unbound parameters. Wrap invocation with disabling strictness, and restore after if it was enabled.pull/1903/head
parent
cd65e0925f
commit
0c412442f5
|
|
@ -3,6 +3,14 @@
|
||||||
# Loads the system's Bash completion modules.
|
# Loads the system's Bash completion modules.
|
||||||
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
||||||
|
|
||||||
|
if shopt -qo nounset
|
||||||
|
then # Bash-completion is too large and complex to expect to handle unbound variables throughout the whole codebase.
|
||||||
|
BASH_IT_RESTORE_NOUNSET=true
|
||||||
|
shopt -uo nounset
|
||||||
|
else
|
||||||
|
BASH_IT_RESTORE_NOUNSET=false
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -r "${BASH_COMPLETION:-}" ]] ; then
|
if [[ -r "${BASH_COMPLETION:-}" ]] ; then
|
||||||
source "${BASH_COMPLETION}"
|
source "${BASH_COMPLETION}"
|
||||||
elif [[ -r /etc/bash_completion ]] ; then
|
elif [[ -r /etc/bash_completion ]] ; then
|
||||||
|
|
@ -22,3 +30,9 @@ then
|
||||||
source "$BASH_IT_HOMEBREW_PREFIX"/etc/profile.d/bash_completion.sh
|
source "$BASH_IT_HOMEBREW_PREFIX"/etc/profile.d/bash_completion.sh
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if $BASH_IT_RESTORE_NOUNSET
|
||||||
|
then
|
||||||
|
shopt -so nounset
|
||||||
|
fi
|
||||||
|
unset BASH_IT_RESTORE_NOUNSET
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue