1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

bash-completion: resolve: add missing options

This commit is contained in:
Yu Watanabe 2018-01-10 22:39:04 +09:00
parent 86b4188d5e
commit 14aeb7ce7f

View File

@ -36,11 +36,13 @@ _systemd-resolve() {
local i comps
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-h --help --version -4 -6
[STANDALONE]='-h --help --version --no-pager -4 -6
--service --openpgp --tlsa --status --statistics
--reset-statistics --service-address=no --service-txt=no
--cname=no --search=no --legend=no'
[ARG]='-i --interface -p --protocol -t --type -c --class'
--cname=no --search=no --legend=no --flush-caches
--reset-server-features --revert'
[ARG]='-i --interface -p --protocol -t --type -c --class --raw
--set-dns --set-domain --set-llmnr --set-mdns --set-dnssec --set-nta'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
@ -51,6 +53,18 @@ _systemd-resolve() {
--protocol|-p|--type|-t|--class|-c)
comps=$( systemd-resolve --legend=no "$prev" help; echo help )
;;
--raw)
comps="payload packet"
;;
--set-dns|--set-domain|--set-nta)
comps=""
;;
--set-llmnr|--set-mdns)
comps="yes no resolve"
;;
--set-dnssec)
comps="yes no allow-downgrade"
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0