mirror of
https://github.com/spf13/cobra
synced 2025-05-05 04:47:22 +00:00
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:
parent
933caf637f
commit
966d0a8b85
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue