File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,17 @@ _comp_cmd_mr()
19
19
commands=" ${commands//@ (action|[\[\|\]])/ $' \n ' } "
20
20
# Add standard aliases.
21
21
commands=" ${commands} ci co ls"
22
+ _comp_split commands " $commands "
23
+ local IFS=' |'
24
+ local glob_commands=" @(${commands[*]} )"
25
+ _comp_unlocal IFS
22
26
23
27
# Determine if user has entered an `mr` command. Used to block top-level
24
28
# (option and command) completions.
25
29
local cmd has_cmd=" " i
26
30
for (( i = 1 ; i < ${# words[@]} - 1 ; i++ )) ; do
27
- if [[ $commands == * " ${words[i]} " * ]]; then
31
+ # shellcheck disable=SC2053
32
+ if [[ ${words[i]} == $glob_commands ]]; then
28
33
cmd=" ${words[i]} "
29
34
has_cmd=set
30
35
break
@@ -85,7 +90,7 @@ _comp_cmd_mr()
85
90
# -X '--path': Remove deprecated options.
86
91
_comp_compgen -- -W ' "${options[@]}"' -X ' @(-[a-z]|--path)'
87
92
else
88
- _comp_compgen -- -W " ${commands} "
93
+ _comp_compgen -- -W ' "${commands[@]}" '
89
94
fi
90
95
} &&
91
96
complete -F _comp_cmd_mr mr
You can’t perform that action at this time.
0 commit comments