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."
],
...
}
]
}
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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"]'
|
||||
|
||||
Reference in New Issue
Block a user