mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
Fix completions for "set -u"
This commit is contained in:
parent
de187e874d
commit
ff4265b6a2
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ func writePreamble(buf io.StringWriter, name string) {
|
|||
WriteStringAndCheck(buf, fmt.Sprintf(`
|
||||
__%[1]s_debug()
|
||||
{
|
||||
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
|
||||
if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
|
||||
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ func genZshComp(buf io.StringWriter, name string, includeDesc bool) {
|
|||
|
||||
__%[1]s_debug()
|
||||
{
|
||||
local file="$BASH_COMP_DEBUG_FILE"
|
||||
local file="${BASH_COMP_DEBUG_FILE-}"
|
||||
if [[ -n ${file} ]]; then
|
||||
echo "$*" >> "${file}"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue