@@ -24,7 +24,7 @@ _comp_cmd_rndc()
24
24
25
25
case $prev in
26
26
-c|-k)
27
- _comp_compgen -a filedir
27
+ _comp_compgen filedir
28
28
return
29
29
;;
30
30
-s)
@@ -36,15 +36,14 @@ _comp_cmd_rndc()
36
36
local REPLY
37
37
_comp_count_args
38
38
if (( REPLY == 1 )) ; then
39
- _comp_compgen -- -W " $( _comp_cmd_rndc__list_commands) "
40
- fi
41
- if (( REPLY == 2 )) ; then
39
+ _comp_compgen_split -- " $( _comp_cmd_rndc__list_commands) "
40
+ elif (( REPLY == 2 )) ; then
42
41
local PARAMS=" $( _comp_cmd_rndc__list_parameters $prev ) "
43
42
if [[ " $PARAMS " == zone ]]; then
44
- _comp_compgen -- -W " $( _comp_cmd_named_checkconf__list_zones) "
43
+ _comp_compgen_split -- " $( _comp_cmd_named_checkconf__list_zones) "
45
44
return
46
45
else
47
- _comp_compgen -- -W " $PARAMS "
46
+ _comp_compgen_split -- " $PARAMS "
48
47
fi
49
48
fi
50
49
if [[ $cur == -* ]]; then
@@ -55,8 +54,8 @@ _comp_cmd_rndc()
55
54
56
55
_comp_cmd_dig__list_plusopts ()
57
56
{
58
- local CMD=${1:- dig} # delv and mdig has similar style options
59
- $CMD -h 2>&1 | awk ' /^\s+\+\[no\]/ { sub("+\\[no\\]", "", $1); sub("=##+$", "=", $1); sub("\\[=##+\\]", "", $1); print "+"$1, "+no"$1} /^\s+\+[^[]/ {sub("=##+", "=", $1); print $1}'
57
+ local CMD=" ${1:- dig} " # delv and mdig has similar style options
58
+ " $CMD " -h 2>&1 | awk ' /^\s+\+\[no\]/ { sub("+\\[no\\]", "", $1); sub("=##+$", "=", $1); sub("\\[=##+\\]", "", $1); print "+"$1, "+no"$1} /^\s+\+[^[]/ {sub("=##+", "=", $1); print $1}'
60
59
}
61
60
62
61
_comp_cmd_dig ()
@@ -78,7 +77,7 @@ _comp_cmd_dig()
78
77
return
79
78
;;
80
79
-k|-f)
81
- _comp_compgen -a filedir
80
+ _comp_compgen filedir
82
81
return
83
82
;;
84
83
-x|-b)
@@ -90,15 +89,13 @@ _comp_cmd_dig()
90
89
if [[ $cur == -* ]]; then
91
90
_comp_compgen_usage
92
91
return
93
- fi
94
- if [[ $cur == @* ]]; then
92
+ elif [[ $cur == @* ]]; then
95
93
_comp_compgen_known_hosts -- " $cur "
96
94
return
97
- fi
98
- if [[ $cur == +* ]]; then
99
- _comp_compgen -- -W " $( _comp_cmd_dig__list_plusopts dig) "
95
+ elif [[ $cur == +* ]]; then
96
+ _comp_compgen_split -- " $( _comp_cmd_dig__list_plusopts dig) "
100
97
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
101
-
98
+ return
102
99
fi
103
100
104
101
# TODO: dig is tricky. It can accept hostname, queryclass or querytype without any parameter.
@@ -125,7 +122,7 @@ _comp_cmd_mdig()
125
122
return
126
123
;;
127
124
-f)
128
- _comp_compgen -a filedir
125
+ _comp_compgen filedir
129
126
return
130
127
;;
131
128
-x|-b)
@@ -137,13 +134,11 @@ _comp_cmd_mdig()
137
134
if [[ $cur == -* ]]; then
138
135
_comp_compgen_usage
139
136
return
140
- fi
141
- if [[ $cur == @* ]]; then
137
+ elif [[ $cur == @* ]]; then
142
138
_comp_compgen_known_hosts -- " $cur "
143
139
return
144
- fi
145
- if [[ $cur == +* ]]; then
146
- _comp_compgen -- -W " $( _comp_cmd_dig__list_plusopts mdig) "
140
+ elif [[ $cur == +* ]]; then
141
+ _comp_compgen_split -- " $( _comp_cmd_dig__list_plusopts mdig) "
147
142
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
148
143
149
144
fi
@@ -172,7 +167,7 @@ _comp_cmd_delv()
172
167
return
173
168
;;
174
169
-a)
175
- _comp_compgen -a filedir
170
+ _comp_compgen filedir
176
171
return
177
172
;;
178
173
-x|-b)
@@ -190,7 +185,7 @@ _comp_cmd_delv()
190
185
return
191
186
fi
192
187
if [[ $cur == +* ]]; then
193
- _comp_compgen -- -W " $( _comp_cmd_dig__list_plusopts delv) "
188
+ _comp_compgen_split -- " $( _comp_cmd_dig__list_plusopts delv) "
194
189
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
195
190
196
191
fi
0 commit comments