File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ completion/available/dart.completion.bash
50
50
completion/available/defaults.completion.bash
51
51
#completion/available/dirs.completion.bash
52
52
completion/available/django.completion.bash
53
- # completion/available/dmidecode.completion.bash
53
+ completion/available/dmidecode.completion.bash
54
54
completion/available/docker-machine.completion.bash
55
55
completion/available/docker.completion.bash
56
56
completion/available/dotnet.completion.bash
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
- function __dmidecode_completion() {
4
- # shellcheck disable=SC2155
5
- local prev=$( _get_pword)
6
- # shellcheck disable=SC2155
7
- local curr=$( _get_cword)
3
+ # Make sure dmidecode is installed
4
+ _bash-it-completion-helper-necessary dmidecode || :
5
+
6
+ # Don't handle completion if it's already managed
7
+ _bash-it-completion-helper-sufficient dmidecode || return
8
+
9
+ function _dmidecode() {
10
+ local prev=" ${COMP_WORDS[COMP_CWORD - 1]} "
8
11
9
12
case $prev in
10
13
-s | --string | -t | --type)
11
14
OPTS=$( dmidecode " $prev " 2>&1 | grep -E ' ^ ' | sed ' s/ *//g' )
12
15
# shellcheck disable=SC2207
13
- COMPREPLY=($( compgen -W " $ OPTS" -- " $curr " ) )
16
+ COMPREPLY=(" ${ OPTS[@]} " )
14
17
;;
15
18
dmidecode)
16
19
# shellcheck disable=SC2207
17
- COMPREPLY=($( compgen -W " -d --dev-mem -h --help -q --quiet -s --string -t --type -H --handle -u --dump{,- bin} --from-dump --no-sysfs --oem-string -V --version" -- " $curr " ) )
20
+ COMPREPLY=(" -d" " --dev-mem" " -h " " --help" " -q " " --quiet" " -s " " --string" " -t " " --type" " -H " " --handle" " -u " " --dump" " -dump- bin" " --from-dump" " --no-sysfs" " --oem-string" " -V " " --version" )
18
21
;;
19
22
esac
20
23
}
21
24
22
- complete -F __dmidecode_completion dmidecode
25
+ complete -F _dmidecode -X ' !&* ' dmidecode
You can’t perform that action at this time.
0 commit comments