@@ -151,13 +151,10 @@ __grub_list_modules () {
151
151
# grub-set-default & grub-reboot
152
152
#
153
153
__grub_set_entry () {
154
- local cur prev split=false
154
+ local cur prev words cword split
155
+ _init_completion -s || return
155
156
156
157
COMPREPLY=()
157
- cur=` _get_cword`
158
- prev=${COMP_WORDS[COMP_CWORD-1]}
159
-
160
- _split_longopt && split=true
161
158
162
159
case " $prev " in
163
160
--boot-directory)
@@ -180,11 +177,10 @@ __grub_set_entry () {
180
177
# grub-editenv
181
178
#
182
179
__grub_editenv () {
183
- local cur prev
180
+ local cur prev words cword
181
+ _init_completion || return
184
182
185
183
COMPREPLY=()
186
- cur=` _get_cword`
187
- prev=${COMP_WORDS[COMP_CWORD-1]}
188
184
189
185
case " $prev " in
190
186
create|list|set|unset)
@@ -201,10 +197,10 @@ __grub_editenv () {
201
197
# grub-mkconfig
202
198
#
203
199
__grub_mkconfig () {
204
- local cur prev
200
+ local cur prev words cword
201
+ _init_completion || return
205
202
206
203
COMPREPLY=()
207
- cur=` _get_cword`
208
204
209
205
if [[ " $cur " == -* ]]; then
210
206
__grubcomp " $( __grub_get_options_from_help) "
@@ -217,13 +213,10 @@ __grub_mkconfig () {
217
213
# grub-setup
218
214
#
219
215
__grub_setup () {
220
- local cur prev split=false
216
+ local cur prev words cword split
217
+ _init_completion -s || return
221
218
222
219
COMPREPLY=()
223
- cur=` _get_cword`
224
- prev=${COMP_WORDS[COMP_CWORD-1]}
225
-
226
- _split_longopt && split=true
227
220
228
221
case " $prev " in
229
222
-d|--directory)
@@ -246,15 +239,12 @@ __grub_setup () {
246
239
# grub-install
247
240
#
248
241
__grub_install () {
249
- local cur prev last split=false
242
+ local cur prev words cword split last
243
+ _init_completion -s || return
250
244
251
245
COMPREPLY=()
252
- cur=` _get_cword`
253
- prev=${COMP_WORDS[COMP_CWORD-1]}
254
246
last=$( __grub_get_last_option)
255
247
256
- _split_longopt && split=true
257
-
258
248
case " $prev " in
259
249
--boot-directory)
260
250
_filedir -d
@@ -287,10 +277,10 @@ __grub_install () {
287
277
# grub-mkfont
288
278
#
289
279
__grub_mkfont () {
290
- local cur
280
+ local cur prev words cword
281
+ _init_completion || return
291
282
292
283
COMPREPLY=()
293
- cur=` _get_cword`
294
284
295
285
if [[ " $cur " == -* ]]; then
296
286
__grubcomp " $( __grub_get_options_from_help) "
@@ -304,11 +294,10 @@ __grub_mkfont () {
304
294
# grub-mkrescue
305
295
#
306
296
__grub_mkrescue () {
307
- local cur prev last
297
+ local cur prev words cword last
298
+ _init_completion || return
308
299
309
300
COMPREPLY=()
310
- cur=` _get_cword`
311
- prev=${COMP_WORDS[COMP_CWORD-1]}
312
301
last=$( __grub_get_last_option)
313
302
314
303
if [[ " $cur " == -* ]]; then
@@ -330,13 +319,10 @@ __grub_mkrescue () {
330
319
# grub-mkimage
331
320
#
332
321
__grub_mkimage () {
333
- local cur prev split=false
322
+ local cur prev words cword split
323
+ _init_completion -s || return
334
324
335
325
COMPREPLY=()
336
- cur=` _get_cword`
337
- prev=${COMP_WORDS[COMP_CWORD-1]}
338
-
339
- _split_longopt && split=true
340
326
341
327
case " $prev " in
342
328
-d|--directory|-p|--prefix)
@@ -367,10 +353,10 @@ __grub_mkimage () {
367
353
# grub-mkpasswd-pbkdf2
368
354
#
369
355
__grub_mkpasswd_pbkdf2 () {
370
- local cur
356
+ local cur prev words cword
357
+ _init_completion || return
371
358
372
359
COMPREPLY=()
373
- cur=` _get_cword`
374
360
375
361
if [[ " $cur " == -* ]]; then
376
362
__grubcomp " $( __grub_get_options_from_help) "
@@ -384,13 +370,10 @@ __grub_mkpasswd_pbkdf2 () {
384
370
# grub-probe
385
371
#
386
372
__grub_probe () {
387
- local cur prev split=false
373
+ local cur prev words cword split
374
+ _init_completion -s || return
388
375
389
376
COMPREPLY=()
390
- cur=` _get_cword`
391
- prev=${COMP_WORDS[COMP_CWORD-1]}
392
-
393
- _split_longopt && split=true
394
377
395
378
case " $prev " in
396
379
-t|--target)
@@ -417,10 +400,10 @@ __grub_probe () {
417
400
# grub-script-check
418
401
#
419
402
__grub_script_check () {
420
- local cur
403
+ local cur prev words cword
404
+ _init_completion || return
421
405
422
406
COMPREPLY=()
423
- cur=` _get_cword`
424
407
425
408
if [[ " $cur " == -* ]]; then
426
409
__grubcomp " $( __grub_get_options_from_help) "
0 commit comments