Skip to content

Commit 5701a79

Browse files
committed
fix: use _comp_compgen for COMPREPLY=($(compgen ... -- "$cur"))
1 parent 1623682 commit 5701a79

File tree

257 files changed

+708
-708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+708
-708
lines changed

completions/7z

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _comp_cmd_7z()
66
_comp_initialize -n = -- "$@" || return
77

88
if ((cword == 1)); then
9-
COMPREPLY=($(compgen -W 'a b d e h i l rn t u x' -- "$cur"))
9+
_comp_compgen -- -W 'a b d e h i l rn t u x'
1010
return
1111
fi
1212

completions/_adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ _comp_cmd_adb()
4444
tmp+=(devices connect disconnect sideload)
4545
fi
4646
((${#tmp[@]})) &&
47-
COMPREPLY=($(compgen -W '"${tmp[@]}"' -- "$cur"))
47+
_comp_compgen -- -W '"${tmp[@]}"'
4848
return
4949
fi
5050

@@ -62,7 +62,7 @@ _comp_cmd_adb()
6262
_parse_help -)' -- "$cur"))
6363
;;
6464
reboot)
65-
COMPREPLY=($(compgen -W 'bootloader recovery' -- "$cur"))
65+
_comp_compgen -- -W 'bootloader recovery'
6666
;;
6767
esac
6868
} &&

completions/_cal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _comp_cmd_cal()
1111
case $prev in
1212
-m)
1313
if [[ $OSTYPE == *bsd* ]]; then
14-
COMPREPLY=($(compgen -W '{1..12}' -- "$cur"))
14+
_comp_compgen -- -W '{1..12}'
1515
return
1616
fi
1717
;;
@@ -32,7 +32,7 @@ _comp_cmd_cal()
3232

3333
local args
3434
_count_args
35-
((args == 1)) && COMPREPLY=($(compgen -W '{1..12}' -- "$cur"))
35+
((args == 1)) && _comp_compgen -- -W '{1..12}'
3636
} &&
3737
complete -F _comp_cmd_cal cal ncal
3838

completions/_dmesg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _comp_cmd_dmesg()
2020
return
2121
;;
2222
-l | --level | -n | --console-level)
23-
COMPREPLY=($(compgen -W '{1..8}' -- "$cur"))
23+
_comp_compgen -- -W '{1..8}'
2424
return
2525
;;
2626
esac

completions/_eject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _comp_cmd_eject()
1313
return
1414
;;
1515
-a | --auto | -i | --manualeject)
16-
COMPREPLY=($(compgen -W 'on off' -- "$cur"))
16+
_comp_compgen -- -W 'on off'
1717
return
1818
;;
1919
esac

completions/_ionice

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ _comp_cmd_ionice()
3737

3838
case $prev in
3939
-c)
40-
COMPREPLY=($(compgen -W '{0..3}' -- "$cur"))
40+
_comp_compgen -- -W '{0..3}'
4141
return
4242
;;
4343
-n)
44-
COMPREPLY=($(compgen -W '{0..7}' -- "$cur"))
44+
_comp_compgen -- -W '{0..7}'
4545
return
4646
;;
4747
-p)

completions/_mock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ _comp_cmd_mock()
5050
return
5151
;;
5252
--enable-plugin | --disable-plugin)
53-
COMPREPLY=($(compgen -W "$plugins" -- "$cur"))
53+
_comp_compgen -- -W "$plugins"
5454
return
5555
;;
5656
esac

completions/_modules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ _comp_cmd_module()
6060
options="$(module help 2>&1 | command grep -E '^[[:space:]]*\+' |
6161
awk '{print $2}' | command sed -e 's/|/ /g' | sort)"
6262

63-
COMPREPLY=($(compgen -W "$options" -- "$cur"))
63+
_comp_compgen -- -W "$options"
6464

6565
elif ((cword == 2)); then
6666
case $prev in

completions/_nmcli

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
_comp_cmd_nmcli__list()
77
{
8-
COMPREPLY=($(compgen -W '$1' -- "$cur"))
8+
_comp_compgen -- -W '$1'
99
}
1010

1111
_comp_cmd_nmcli__con_id()
@@ -41,11 +41,11 @@ _comp_cmd_nmcli()
4141

4242
case $prev in
4343
-m | --mode)
44-
COMPREPLY=($(compgen -W 'tabular multiline' -- "$cur"))
44+
_comp_compgen -- -W 'tabular multiline'
4545
return
4646
;;
4747
-f | --fields)
48-
COMPREPLY=($(compgen -W 'all common' -- "$cur"))
48+
_comp_compgen -- -W 'all common'
4949
return
5050
;;
5151
-e | --escape)
@@ -79,7 +79,7 @@ _comp_cmd_nmcli()
7979
COMPREPLY=($(compgen -W '--terse --pretty --mode --fields
8080
--escape --version --help' -- "$cur"))
8181
else
82-
COMPREPLY=($(compgen -W "nm con dev" -- "$cur"))
82+
_comp_compgen -- -W "nm con dev"
8383
fi
8484
else
8585
local object=${words[1]}
@@ -116,7 +116,7 @@ _comp_cmd_nmcli()
116116
con)
117117
case $command in
118118
list)
119-
COMPREPLY=($(compgen -W 'id uuid' -- "$cur"))
119+
_comp_compgen -- -W 'id uuid'
120120
return
121121
;;
122122
up)
@@ -130,11 +130,11 @@ _comp_cmd_nmcli()
130130
return
131131
;;
132132
down)
133-
COMPREPLY=($(compgen -W 'id uuid' -- "$cur"))
133+
_comp_compgen -- -W 'id uuid'
134134
return
135135
;;
136136
delete)
137-
COMPREPLY=($(compgen -W 'id uuid' -- "$cur"))
137+
_comp_compgen -- -W 'id uuid'
138138
return
139139
;;
140140
esac
@@ -145,15 +145,15 @@ _comp_cmd_nmcli()
145145
dev)
146146
case $command in
147147
list)
148-
COMPREPLY=($(compgen -W 'iface' -- "$cur"))
148+
_comp_compgen -- -W 'iface'
149149
return
150150
;;
151151
disconnect)
152152
if [[ $cur == -* ]]; then
153153
COMPREPLY=($(compgen -W '--nowait --timeout' \
154154
-- "$cur"))
155155
else
156-
COMPREPLY=($(compgen -W 'iface' -- "$cur"))
156+
_comp_compgen -- -W 'iface'
157157
fi
158158
return
159159
;;
@@ -183,7 +183,7 @@ _comp_cmd_nmcli()
183183
;;
184184
esac
185185

186-
COMPREPLY=($(compgen -W 'list connect' -- "$cur"))
186+
_comp_compgen -- -W 'list connect'
187187
return
188188
;;
189189
esac

completions/_rfkill

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _comp_cmd_rfkill()
99
_comp_initialize -- "$@" || return
1010

1111
if [[ $cur == -* ]]; then
12-
COMPREPLY=($(compgen -W '--version' -- "$cur"))
12+
_comp_compgen -- -W '--version'
1313
else
1414
case $cword in
1515
1)

0 commit comments

Comments
 (0)