@@ -2765,18 +2765,18 @@ _comp_command_offset()
2765
2765
else
2766
2766
_comp_dequote " ${COMP_WORDS[0]} " || REPLY=${COMP_WORDS[0]}
2767
2767
local cmd=$REPLY compcmd=$REPLY
2768
- local cspec=$( complete -p " $cmd " 2> /dev/null)
2768
+ local cspec=$( complete -p -- " $cmd " 2> /dev/null)
2769
2769
2770
2770
# If we have no completion for $cmd yet, see if we have for basename
2771
2771
if [[ ! $cspec && $cmd == * /* ]]; then
2772
- cspec=$( complete -p " ${cmd##*/ } " 2> /dev/null)
2772
+ cspec=$( complete -p -- " ${cmd##*/ } " 2> /dev/null)
2773
2773
[[ $cspec ]] && compcmd=${cmd##*/ }
2774
2774
fi
2775
2775
# If still nothing, just load it for the basename
2776
2776
if [[ ! $cspec ]]; then
2777
2777
compcmd=${cmd##*/ }
2778
2778
_comp_load -D -- " $compcmd "
2779
- cspec=$( complete -p " $compcmd " 2> /dev/null)
2779
+ cspec=$( complete -p -- " $compcmd " 2> /dev/null)
2780
2780
fi
2781
2781
2782
2782
local retry_count=0
@@ -2809,7 +2809,7 @@ _comp_command_offset()
2809
2809
# state of COMPREPLY is discarded.
2810
2810
COMPREPLY=()
2811
2811
2812
- cspec=$( complete -p " $compcmd " 2> /dev/null)
2812
+ cspec=$( complete -p -- " $compcmd " 2> /dev/null)
2813
2813
2814
2814
# Note: When completion spec is removed after 124, we
2815
2815
# do not generate any completions including the default
@@ -3147,7 +3147,7 @@ _comp_load()
3147
3147
if [[ $cmd == \\ * ]]; then
3148
3148
cmd=${cmd: 1}
3149
3149
# If we already have a completion for the " real" command, use it
3150
- $( complete -p " $cmd " 2> /dev/null || echo false) " \\ $cmd " && return 0
3150
+ $( complete -p -- " $cmd " 2> /dev/null || echo false) " \\ $cmd " && return 0
3151
3151
backslash=\\
3152
3152
fi
3153
3153
@@ -3222,18 +3222,18 @@ _comp_load()
3222
3222
elif [[ -e $compfile ]] && . " $compfile " " $cmd " " $@ " ; then
3223
3223
# At least $cmd is expected to have a completion set when
3224
3224
# we return successfully; see if it already does
3225
- if compspec=$( complete -p " $cmd " 2> /dev/null) ; then
3225
+ if compspec=$( complete -p -- " $cmd " 2> /dev/null) ; then
3226
3226
# $cmd is the case in which we do backslash processing
3227
3227
[[ $backslash ]] && eval " $compspec \"\$ backslash\$ cmd\" "
3228
3228
# If invoked without path, that one should be set, too
3229
3229
# ...but let's not overwrite an existing one, if any
3230
3230
[[ $origcmd != */* ]] &&
3231
- ! complete -p " $origcmd " &>/dev/null &&
3231
+ ! complete -p -- " $origcmd " &>/dev/null &&
3232
3232
eval " $compspec \"\$ origcmd\" "
3233
3233
return 0
3234
3234
fi
3235
3235
# If not, see if we got one for $cmdname
3236
- if [[ $cmdname != " $cmd " ]] && compspec=$( complete -p " $cmdname " 2> /dev/null) ; then
3236
+ if [[ $cmdname != " $cmd " ]] && compspec=$( complete -p -- " $cmdname " 2> /dev/null) ; then
3237
3237
# Use that for $cmd too, if we have a full path to it
3238
3238
[[ $cmd == /* ]] && eval " $compspec \"\$ cmd\" "
3239
3239
return 0
0 commit comments