fix: bash completion fallback in nounset mode

With the shell in `nounset` mode, the intended fallback to filename
completion provokes an error:

```
$ cargo foo <TAB>bash: !opt_var: unbound variable
```
This commit is contained in:
Ville Skyttä 2024-04-01 21:45:05 +00:00
parent 631b077003
commit c1ffe80d61

View File

@ -154,7 +154,7 @@ _cargo()
else
local opt_var=opt__${cmd//-/_}
fi
if [[ -z "${!opt_var}" ]]; then
if [[ -z "${!opt_var-}" ]]; then
# Fallback to filename completion.
_filedir
else