Skip to content

Commit 99fdcbe

Browse files
committed
refactor(nmcli): use _comp_compgen instead of _comp_cmd_nmcli__list
1 parent c2d7fb7 commit 99fdcbe

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

completions/_nmcli

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# Use of this file is deprecated. Upstream completion is available in
44
# NetworkManager >= 0.9.8.0, use that instead.
55

6-
_comp_cmd_nmcli__list()
7-
{
8-
_comp_compgen -- -W '$1'
9-
}
10-
116
_comp_cmd_nmcli__con_id()
127
{
138
local IFS=$'\n'
@@ -49,7 +44,7 @@ _comp_cmd_nmcli()
4944
return
5045
;;
5146
-e | --escape)
52-
_comp_cmd_nmcli__list "yes no"
47+
_comp_compgen -- -W "yes no"
5348
return
5449
;;
5550
id)
@@ -69,7 +64,7 @@ _comp_cmd_nmcli()
6964
return
7065
;;
7166
wep-key-type)
72-
_comp_cmd_nmcli__list "key phrase"
67+
_comp_compgen -- -W "key phrase"
7368
return
7469
;;
7570
esac
@@ -89,23 +84,23 @@ _comp_cmd_nmcli()
8984
nm)
9085
case $command in
9186
enable)
92-
_comp_cmd_nmcli__list "true false"
87+
_comp_compgen -- -W "true false"
9388
return
9489
;;
9590
sleep)
96-
_comp_cmd_nmcli__list "true false"
91+
_comp_compgen -- -W "true false"
9792
return
9893
;;
9994
wifi)
100-
_comp_cmd_nmcli__list "on off"
95+
_comp_compgen -- -W "on off"
10196
return
10297
;;
10398
wwan)
104-
_comp_cmd_nmcli__list "on off"
99+
_comp_compgen -- -W "on off"
105100
return
106101
;;
107102
wimax)
108-
_comp_cmd_nmcli__list "on off"
103+
_comp_compgen -- -W "on off"
109104
return
110105
;;
111106
esac

0 commit comments

Comments
 (0)