From 8a14181f55fd62d1763df886342d8bfb1918af42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 29 Jul 2026 10:18:16 -0600 Subject: [PATCH] resolvectl: separate systemd-resolve in introspection data Previously, the systemd-resolve compat alias was described in the same CommandDescription structure and resolvectl. But they have different option sets, so this doesn't really work. The alias is deprecated, so describe it as such in the abstract, but give it a separate entry. $ build/resolvectl --introspect-cli { "mediaType": "application/vnd.io.systemd.cli-introspection-0", "commands": [ { "names": [ "resolvconf" ], "abstract": [ "Register DNS server and domain configuration with systemd-resolved." ], ... }, { "names": [ "resolvectl" ], "abstract": [ "Send control commands to the network name resolution manager, or\nresolve domain names, IPv4 and IPv6 addresses, DNS records, and services." ], ... }, { "names": [ "systemd-resolve" ], "abstract": [ "Send control commands to the network name resolution manager, or\nresolve domain names, IPv4 and IPv6 addresses, DNS records, and services.\n\nThis command is deprecated. Use resolvectl.1 instead." ], ... } ] } --- src/resolve/resolvectl.c | 9 ++++++++- test/units/TEST-74-AUX-UTILS.introspect-cli.sh | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 08e6958d76..c774d93211 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -96,7 +96,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_set_domain, strv_freep); STATIC_DESTRUCTOR_REGISTER(arg_set_nta, strv_freep); COMMAND( - "resolvectl\0systemd-resolve\0", + "resolvectl\0", "Send control commands to the network name resolution manager, or\n" "resolve domain names, IPv4 and IPv6 addresses, DNS records, and services.", .man_pages = "resolvectl.1\0", @@ -3220,6 +3220,13 @@ static void help_dns_classes(void) { VERB_COMMON_HELP_AUTO_HIDDEN("resolvectl"); +COMMAND( + "systemd-resolve\0", + "This command is deprecated. Use resolvectl.1 instead.", + .man_pages = "resolvectl.1\0", + .option_namespace = "systemd-resolve", +); + static int compat_parse_argv(int argc, char *argv[], char ***remaining_args) { int r; diff --git a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh index 1752bdc238..8e8789bd31 100755 --- a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh +++ b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh @@ -32,4 +32,4 @@ systemd-id128 --introspect-cli | jq -e \ # resolvectl is a multicall binary, check that both commands are described resolvectl --introspect-cli | jq -e \ - '[.commands[].names[0]] | sort == ["resolvconf", "resolvectl"]' + '[.commands[].names[0]] | sort == ["resolvconf", "resolvectl", "systemd-resolve"]'