File tree Expand file tree Collapse file tree 9 files changed +23
-16
lines changed Expand file tree Collapse file tree 9 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ _comp_cmd_hwclock()
18
18
;;
19
19
esac
20
20
21
- COMPREPLY=(
22
- $( PATH= " $PATH :/sbin " compgen -W ' $(_parse_help "$1") ' -- " $cur " ) )
21
+ local PATH= $PATH :/sbin
22
+ _comp_compgen_help
23
23
} &&
24
24
complete -F _comp_cmd_hwclock hwclock
25
25
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ _comp_cmd_badblocks()
17
17
18
18
if [[ $cur == -* ]]; then
19
19
# Filter out -w (dangerous) and -X (internal use)
20
- COMPREPLY=($( compgen -X ' -[wX]' -W ' $(_parse_usage "$1")' -- " $cur " ) )
20
+ _comp_compgen -R usage
21
+ (( ${# COMPREPLY[@]} )) &&
22
+ _comp_compgen -- -X ' -[wX]' -W ' "${COMPREPLY[@]}"'
21
23
return
22
24
fi
23
25
Original file line number Diff line number Diff line change @@ -37,8 +37,9 @@ _comp_cmd_dnssec_keygen()
37
37
esac
38
38
39
39
if [[ $cur == -* ]]; then
40
- COMPREPLY=($( compgen -W ' $(_parse_help "$1" | \
41
- command sed -e "s/:\$//")' -- " $cur " ) )
40
+ _comp_compgen -R help
41
+ (( ${# COMPREPLY[@]} )) &&
42
+ _comp_compgen -- -W ' "${COMPREPLY[@]%:}"'
42
43
return
43
44
fi
44
45
} &&
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ _comp_cmd_jps()
12
12
esac
13
13
14
14
if [[ $cur == -* ]]; then
15
- # Not using _parse_usage because output has [-help] which does not
16
- # mean -h, -e, -l, -p...
15
+ # Not using _comp_compgen_usage because output has [-help] which does
16
+ # not mean -h, -e, -l, -p...
17
17
_comp_compgen -- -W " -q -m -l -v -V -J -help"
18
18
[[ ${COMPREPLY-} == -J* ]] && compopt -o nospace
19
19
else
Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ _comp_cmd_links()
80
80
esac
81
81
82
82
if [[ $cur == -* ]]; then
83
- COMPREPLY=($( compgen -W ' $(_parse_help "$1" |
84
- command grep -vF -- "->")' -- " $cur " ) )
83
+ _comp_compgen -R help
84
+ (( ${# COMPREPLY[@]} )) &&
85
+ _comp_compgen -- -W ' "${COMPREPLY[@]}"' -X " ->"
85
86
return
86
87
fi
87
88
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ _comp_cmd_ps()
56
56
esac
57
57
58
58
if [[ $cur == -* ]]; then
59
- # sed: strip single char dashless ", x," that trip _parse_help
59
+ # sed: strip single char dashless ", x," that trip _comp_compgen_help
60
60
_comp_compgen_help - <<< " $({
61
61
" $1 " --help
62
62
" $1 " --help all
Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ _comp_cmd_puppet()
147
147
;;
148
148
* )
149
149
_comp_cmd_puppet__subcmd_opts " $1 " " $subcommand "
150
- # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize]
150
+ # _comp_compgen_usage doesn't grok
151
+ # [-D|--daemonize|--no-daemonize]
151
152
_comp_compgen -a -- -W ' --no-daemonize'
152
153
return
153
154
;;
@@ -298,7 +299,8 @@ _comp_cmd_puppet()
298
299
;;
299
300
* )
300
301
_comp_cmd_puppet__subcmd_opts " $1 " " $subcommand "
301
- # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize]
302
+ # _comp_compgen_usage doesn't grok
303
+ # [-D|--daemonize|--no-daemonize]
302
304
_comp_compgen -a -- -W ' --no-daemonize'
303
305
return
304
306
;;
Original file line number Diff line number Diff line change 19
19
# -------------------------
20
20
#
21
21
# For GNU tar, everything is parsed from `tar --help` output so not so much
22
- # per-distribution work should be needed. The _parse_help does not seem to be
23
- # good enough so parsed here directly.
22
+ # per-distribution work should be needed. The _comp_compgen_help does not seem
23
+ # to be good enough so parsed here directly.
24
24
#
25
25
#
26
26
# FIXME: --starting-file (-K) (should be matched for extraction only)
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ _comp_cmd_zopfli()
12
12
esac
13
13
14
14
if [[ $cur == -* ]]; then
15
- COMPREPLY=($( compgen -W \
16
- ' $(_parse_help "$1" -h | command sed -e "s/#$//")' -- " $cur " ) )
15
+ _comp_compgen -R help -- -h
16
+ (( ${# COMPREPLY[@]} )) &&
17
+ _comp_compgen -- -W ' "${COMPREPLY[@]%#}"'
17
18
[[ ${COMPREPLY-} == --i ]] && compopt -o nospace
18
19
return
19
20
fi
You can’t perform that action at this time.
0 commit comments