completion (feature): dmidecode

pull/1859/head
Gurkirat Singh 2021-03-30 11:01:19 +05:30
parent 4860fb8c60
commit a3ae37b385
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
function __dmidecode_completion() {
local prev=$(_get_pword)
local curr=$(_get_cword)
case $prev in
-s | --string | -t | --type)
OPTS=$(dmidecode $prev 2>&1 | grep -E '^ ' | sed 's/ *//g')
COMPREPLY=($(compgen -W "$OPTS" -- "$curr"))
;;
dmidecode)
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"))
;;
esac
}
complete -F __dmidecode_completion dmidecode