1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-11 04:58:19 +03:00

resolvectl: add some basic highlighting to query output

Let's highlight the actual payload the user requested.
This commit is contained in:
Lennart Poettering 2018-12-05 18:23:48 +01:00
parent 0889b81554
commit 38585af313

View File

@ -244,9 +244,9 @@ static int resolve_host(sd_bus *bus, const char *name) {
if (r < 0)
return log_error_errno(r, "Failed to print address for %s: %m", name);
k = printf("%*s%s %s",
k = printf("%*s%s %s%s%s",
(int) strlen(name), c == 0 ? name : "", c == 0 ? ":" : " ",
pretty);
ansi_highlight(), pretty, ansi_normal());
print_ifindex_comment(k, ifindex);
fputc('\n', stdout);
@ -349,10 +349,10 @@ static int resolve_address(sd_bus *bus, int family, const union in_addr_union *a
if (r < 0)
return r;
k = printf("%*s%s %s",
(int) strlen(pretty), c == 0 ? pretty : "",
c == 0 ? ":" : " ",
n);
k = printf("%*s%s %s%s%s",
(int) strlen(pretty), c == 0 ? pretty : "",
c == 0 ? ":" : " ",
ansi_highlight(), n, ansi_normal());
print_ifindex_comment(k, ifindex);
fputc('\n', stdout);