Skip to content

Commit

Permalink
fix multi
Browse files Browse the repository at this point in the history
  • Loading branch information
joknarf committed Feb 5, 2024
1 parent a4bc3bf commit b85ebb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions complete-ng
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ _complete-ng() {
[ "$_compfunc__D" ] && {
$_compfunc__D "$@" # _completion_loader
\complete -F _complete-ng -I 2>/dev/null
eval $(\complete -p "$cmd" 2>/dev/null) # alias not necessary enable for bash completion loader
eval $(\complete -p -E 2>/dev/null)
eval $(\complete -p "$cmd" 2>/dev/null) # alias not necessary enable for bash completion loader
fn=$(eval printf %s '$'_compfunc_"${cmd//[^a-zA-Z0-9_]/_}")
}
}
Expand Down Expand Up @@ -402,15 +402,15 @@ complete-ng() {
unset fn
! [[ $1 =~ $exc ]] && { func="$1"; shift; set -- "$@" _complete-ng; continue; }
}
[ "$1" = "-F" ] && fn=1 && cmd=""
cmd+="$1 "
[ "$1" = "-F" ] && fn=1 && cmd=()
[ $1 = -- ] || cmd+=("$1")
set -- "$@" "$1"
shift
done
[[ "$*" =~ -F\ [^\ ]*$ ]] && set -- "$@" "''" && cmd="''"
[[ "$*" =~ -F\ [^\ ]*$ ]] && set -- "$@" "''" && cmd=("''")
[ "$func" ] && {
local c
for c in $cmd;do
for c in "${cmd[@]}";do
c=${c//"'"/}
eval "_compfunc_${c//[^a-zA-Z0-9_]/_}=$func"
done
Expand Down

0 comments on commit b85ebb7

Please sign in to comment.