Skip to content

Commit 3c1d9bc

Browse files
committed
fix: use -- to pass arbitrary cmdnames to _comp_load
1 parent 8795ca9 commit 3c1d9bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3281,7 +3281,7 @@ _comp_xfunc()
32813281
local xfunc_name=$2
32823282
[[ $xfunc_name == _* ]] ||
32833283
xfunc_name=_comp_xfunc_${1//[^a-zA-Z0-9_]/_}_$xfunc_name
3284-
declare -F "$xfunc_name" &>/dev/null || _comp_load "$1"
3284+
declare -F "$xfunc_name" &>/dev/null || _comp_load -- "$1"
32853285
"$xfunc_name" "${@:3}"
32863286
}
32873287

test/t/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool:
381381
try:
382382
# Allow _comp_load to fail so we can test completions
383383
# that are directly loaded in bash_completion without a separate file.
384-
assert_bash_exec(bash, "_comp_load %s || :" % cmd)
384+
assert_bash_exec(bash, "_comp_load -- %s || :" % cmd)
385385
assert_bash_exec(bash, "complete -p %s &>/dev/null" % cmd)
386386
except AssertionError:
387387
return False

0 commit comments

Comments
 (0)