Commit Graph
1 Commits
Author SHA1 Message Date
Eden Tsai 6f19fa9f61 fix: unbound variables in bash completion (#1321)
when `set -o nounset` in Bash,
the warnings of unbound variables will break the bash completion.

use `kubectl` as example:

```sh
$ set -o nounset
$ my-cli <Tab>-bash: BASH_COMP_DEBUG_FILE: unbound variable
$
```

the warning break bash completion without any completion result,
and cause my cursor move to the newline.

Use `${variable:-}` substitution in Bash,
that assign an empty string as default for unbound variables to fix the warnings.
2021-12-07 15:44:39 -07:00