Skip to content

Commit 0a5cb89

Browse files
committed
Auto merge of #13686 - scop:fix/cargo-unset-opt-var, r=ehuss
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 ```
2 parents 631b077 + c1ffe80 commit 0a5cb89

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)