X Tutup
Skip to content

Commit f65ccde

Browse files
author
Ronan Pigott
committed
shell-completion: enable resolvectl zsh completion
1 parent 46ff70c commit f65ccde

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#compdef systemd-resolve -*- shell-script -*-
1+
#compdef resolvectl systemd-resolve -*- shell-script -*-
22
# SPDX-License-Identifier: LGPL-2.1+
33
#
44
# This file is part of systemd.
@@ -16,29 +16,29 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
1818

19-
(( $+functions[_systemd-resolve_protocols] )) ||
20-
_systemd-resolve_protocols() {
19+
(( $+functions[_resolvectl_protocols] )) ||
20+
_resolvectl_protocols() {
2121
local -a _protocol
2222
_protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
2323
_values 'protocol' "$_protocol[@]"
2424
}
2525

26-
(( $+functions[_systemd-resolve_types] )) ||
27-
_systemd-resolve_types() {
26+
(( $+functions[_resolvectl_types] )) ||
27+
_resolvectl_types() {
2828
local -a _type
2929
_type=( $(_call_program type ${service} --legend=no --type help; echo help) )
3030
_values 'type' "$_type[@]"
3131
}
3232

33-
(( $+functions[_systemd-resolve_classes] )) ||
34-
_systemd-resolve_classes() {
33+
(( $+functions[_resolvectl_classes] )) ||
34+
_resolvectl_classes() {
3535
local -a _class
3636
_class=( $(_call_program class ${service} --legend=no --class help; echo help) )
3737
_values 'class' "$_class[@]"
3838
}
3939

40-
(( $+functions[_systemd-resolve_none] )) ||
41-
_systemd-resolve_none() {
40+
(( $+functions[_resolvectl_none] )) ||
41+
_resolvectl_none() {
4242
_alternative : \
4343
'domain:DNS address:' \
4444
'address:email address:'
@@ -51,9 +51,9 @@ _arguments \
5151
'-4[Resolve IPv4 addresses]' \
5252
'-6[Resolve IPv6 addresses]' \
5353
{-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
54-
{-p+,--protocol=}'[Look via protocol]:protocol:_systemd-resolve_protocols' \
55-
{-t+,--type=}'[Query RR with DNS type]:type:_systemd-resolve_types' \
56-
{-c+,--class=}'[Query RR with DNS class]:class:_systemd-resolve_classes' \
54+
{-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \
55+
{-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \
56+
{-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \
5757
'--service[Resolve services]' \
5858
'--service-address=no[Do not resolve address for services]' \
5959
'--service-txt=no[Do not resolve TXT records for services]' \
@@ -63,4 +63,4 @@ _arguments \
6363
'--search=no[Do not use search domains]' \
6464
'--statistics[Show resolver statistics]' \
6565
'--reset-statistics[Reset resolver statistics]' \
66-
'*::default: _systemd-resolve_none'
66+
'*::default: _resolvectl_none'

shell-completion/zsh/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if zshcompletiondir != 'no'
3333
['_machinectl', 'ENABLE_MACHINED'],
3434
['_networkctl', 'ENABLE_NETWORKD'],
3535
['_systemd-inhibit', 'ENABLE_LOGIND'],
36-
['_systemd-resolve', 'ENABLE_RESOLVE'],
36+
['_resolvectl', 'ENABLE_RESOLVE'],
3737
['_systemd-tmpfiles', 'ENABLE_TMPFILES'],
3838
['_timedatectl', 'ENABLE_TIMEDATED'],
3939
]

0 commit comments

Comments
 (0)
X Tutup