chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d2592f
)
bash-completion/resolvectl: support privatedns command
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 13 Jun 2018 02:16:26 +0000
(11:16 +0900)
committer
Sven Eden
<yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000
(16:47 +0200)
shell-completion/bash/resolvectl
patch
|
blob
|
history
diff --git
a/shell-completion/bash/resolvectl
b/shell-completion/bash/resolvectl
index cb897fd65e7b4554e0566305f153e42f18f3f3c4..dcacb1269d7ad89c8946aa93c3c25e480da55710 100644
(file)
--- a/
shell-completion/bash/resolvectl
+++ b/
shell-completion/bash/resolvectl
@@
-48,12
+48,14
@@
_resolvectl() {
[LINK]='revert dns domain nta'
[RESOLVE]='llmnr mdns'
[DNSSEC]='dnssec'
[LINK]='revert dns domain nta'
[RESOLVE]='llmnr mdns'
[DNSSEC]='dnssec'
+ [PRIVATEDNS]='privatedns'
[STANDALONE]='statistics reset-statistics flush-caches reset-server-features'
)
local -A ARGS=(
[FAMILY]='tcp udp sctp'
[RESOLVE]='yes no resolve'
[DNSSEC]='yes no allow-downgrade'
[STANDALONE]='statistics reset-statistics flush-caches reset-server-features'
)
local -A ARGS=(
[FAMILY]='tcp udp sctp'
[RESOLVE]='yes no resolve'
[DNSSEC]='yes no allow-downgrade'
+ [PRIVATEDNS]='no opportunistic'
)
local interfaces=$( __get_interfaces )
)
local interfaces=$( __get_interfaces )
@@
-109,7
+111,7
@@
_resolvectl() {
comps=""
fi
comps=""
fi
- elif __contains_word "$verb" ${VERBS[LINK]} ${VERBS[RESOLVE]} ${VERBS[DNSSEC]}; then
+ elif __contains_word "$verb" ${VERBS[LINK]} ${VERBS[RESOLVE]} ${VERBS[DNSSEC]}
${VERBS[PRIVATEDNS]}
; then
for ((i++; i < COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" $interfaces &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
for ((i++; i < COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" $interfaces &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
@@
-153,6
+155,22
@@
_resolvectl() {
comps=''
fi
comps=''
fi
+ elif __contains_word "$verb" ${VERBS[PRIVATEDNS]}; then
+ name=
+ for ((i++; i < COMP_CWORD; i++)); do
+ if __contains_word "${COMP_WORDS[i]}" ${ARGS[PRIVATEDNS]} &&
+ ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
+ name=${COMP_WORDS[i]}
+ break;
+ fi
+ done
+
+ if [[ -z $name ]]; then
+ comps=${ARGS[PRIVATEDNS]}
+ else
+ comps=''
+ fi
+
else
comps=''
fi
else
comps=''
fi