style(bash-v2): use ${foo-} rather than ${foo:-} in emptiness check

The result of the expansion is null no matter if the variable is unset
or null in both cases; the former form is arguably easier on the eye.
This commit is contained in:
Ville Skyttä 2022-05-17 23:32:38 +03:00
parent 933caf637f
commit 966d0a8b85

View file

@ -24,7 +24,7 @@ func genBashComp(buf io.StringWriter, name string, includeDesc bool) {
__%[1]s_debug() __%[1]s_debug()
{ {
if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}" echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi fi
} }