Skip to content

Commit

Permalink
fix: use -- to pass arbitrary cmdnames to _comp_load
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 4, 2024
1 parent 8795ca9 commit 3c1d9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -3281,7 +3281,7 @@ _comp_xfunc()
local xfunc_name=$2
[[ $xfunc_name == _* ]] ||
xfunc_name=_comp_xfunc_${1//[^a-zA-Z0-9_]/_}_$xfunc_name
declare -F "$xfunc_name" &>/dev/null || _comp_load "$1"
declare -F "$xfunc_name" &>/dev/null || _comp_load -- "$1"
"$xfunc_name" "${@:3}"
}
Expand Down
2 changes: 1 addition & 1 deletion test/t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool:
try:
# Allow _comp_load to fail so we can test completions
# that are directly loaded in bash_completion without a separate file.
assert_bash_exec(bash, "_comp_load %s || :" % cmd)
assert_bash_exec(bash, "_comp_load -- %s || :" % cmd)
assert_bash_exec(bash, "complete -p %s &>/dev/null" % cmd)
except AssertionError:
return False
Expand Down

0 comments on commit 3c1d9bc

Please sign in to comment.