Skip to content

Commit c1ffe80

Browse files
committed
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 ```
1 parent 631b077 commit c1ffe80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/etc/cargo.bashcomp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ _cargo()
154154
else
155155
local opt_var=opt__${cmd//-/_}
156156
fi
157-
if [[ -z "${!opt_var}" ]]; then
157+
if [[ -z "${!opt_var-}" ]]; then
158158
# Fallback to filename completion.
159159
_filedir
160160
else

0 commit comments

Comments
 (0)