File tree Expand file tree Collapse file tree 19 files changed +57
-39
lines changed Expand file tree Collapse file tree 19 files changed +57
-39
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ _comp_cmd_chronyc()
29
29
esac
30
30
31
31
if [[ $cur == -* ]]; then
32
- COMPREPLY=($( compgen -W ' $(_parse_usage "$1") -6' -- " $cur " ) )
32
+ _comp_compgen_usage
33
+ _comp_compgen -a -- -W ' -6'
33
34
return
34
35
fi
35
36
Original file line number Diff line number Diff line change @@ -408,9 +408,9 @@ _comp_cmd_cvs()
408
408
;;
409
409
esac
410
410
411
- COMPREPLY=( $( compgen -W ' $(_cvs_commands)
412
- $(_parse_help "$1" --help-options ) --help --help-commands
413
- --help-options --version ' -- " $cur " ) )
411
+ _comp_compgen_help -- --help-options
412
+ _comp_compgen -a -- -W ' $(_cvs_commands ) --help
413
+ --help-commands --help-options --version '
414
414
;;
415
415
esac
416
416
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ _comp_cmd_dd()
31
31
;;
32
32
esac
33
33
34
- COMPREPLY=( $( compgen -W ' $(_parse_help "$1") ' -- " $cur " )
35
- $( compgen -W ' bs cbs conv count ibs if iflag obs of oflag
36
- seek skip status' -S ' =' -- " $cur " ) )
34
+ _comp_compgen_help
35
+ _comp_compgen -a -- -W ' bs cbs conv count ibs if iflag obs of oflag
36
+ seek skip status' -S ' ='
37
37
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
38
38
} &&
39
39
complete -F _comp_cmd_dd dd
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ _comp_cmd_dsniff()
17
17
esac
18
18
19
19
if [[ $cur == -* ]]; then
20
- COMPREPLY=($( compgen -W ' $(_parse_usage "$1") -r -w -p' -- " $cur " ) )
20
+ _comp_compgen_usage
21
+ _comp_compgen -a -- -W ' -r -w -p'
21
22
fi
22
23
23
24
} &&
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ _comp_cmd_ether_wake()
16
16
esac
17
17
18
18
if [[ $cur == -* ]]; then
19
- COMPREPLY=($( compgen -W ' $(_parse_help "$1" -u) -V' -- " $cur " ) )
19
+ _comp_compgen_help -- -u
20
+ _comp_compgen -a -- -W ' -V'
20
21
return
21
22
fi
22
23
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ _comp_cmd_export()
46
46
;;
47
47
* )
48
48
if [[ $cword -eq 1 && $cur == -* ]]; then
49
- COMPREPLY=($( compgen -W ' -p $(_parse_usage help "-s $1")' -- " $cur " ) )
49
+ _comp_compgen_usage -c help -s " $1 "
50
+ _comp_compgen -a -- -W ' -p'
50
51
return
51
52
fi
52
53
local suffix=" "
Original file line number Diff line number Diff line change @@ -140,13 +140,10 @@ _comp_cmd_fio()
140
140
[[ $was_split ]] && return
141
141
142
142
if [[ $cur == -* ]]; then
143
- COMPREPLY=($(
144
- compgen -W '
145
- $(_parse_help "$1")
146
- $("$1" --cmdhelp=all 2>/dev/null | \
147
- awk "{printf \"--%s=\n\", \$1}")
148
- ' -- " $cur "
149
- ) )
143
+ _comp_compgen_help
144
+ local stdout=$( " $1 " --cmdhelp=all 2> /dev/null |
145
+ awk ' {printf "--%s=\n", $1}' )
146
+ _comp_compgen -a -- -W ' $stdout'
150
147
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
151
148
return
152
149
fi
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ _comp_cmd_gzip()
19
19
esac
20
20
21
21
if [[ $cur == -* ]]; then
22
- COMPREPLY=($( compgen -W ' $(_parse_help "$1") {-1..-9}' -- " $cur " ) )
22
+ _comp_compgen_help
23
+ _comp_compgen -a -- -W ' -{1..9}'
23
24
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
24
25
return
25
26
fi
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ _comp_cmd_hddtemp()
28
28
[[ $was_split ]] && return
29
29
30
30
if [[ $cur == -* ]]; then
31
- COMPREPLY=($( compgen -W ' $(_parse_help "$1") --help' -- " $cur " ) )
31
+ _comp_compgen_help
32
+ _comp_compgen -a -- -W ' --help'
32
33
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
33
34
else
34
35
_comp_compgen -c " ${cur:-/ dev/ } " filedir
Original file line number Diff line number Diff line change @@ -23,8 +23,10 @@ _comp_cmd_json_xs()
23
23
;;
24
24
esac
25
25
26
- [[ $cur == -* ]] &&
27
- COMPREPLY=($( compgen -W ' $(_parse_usage "$1") -f' -- " $cur " ) )
26
+ if [[ $cur == -* ]]; then
27
+ _comp_compgen_usage
28
+ _comp_compgen -a -- -W ' -f'
29
+ fi
28
30
} &&
29
31
complete -F _comp_cmd_json_xs json_xs
30
32
You can’t perform that action at this time.
0 commit comments