From 700f5b18e32d529f127f59ce47aa49aa62030290 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 31 Jan 2024 15:56:58 +0100 Subject: [PATCH] resolvectl: add basic ANSI markup to --help text Underline the sections, as we nowadays do. --- src/resolve/resolvectl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 56ba992c4f9..580913b94e4 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -3295,11 +3295,11 @@ static int native_help(void) { if (r < 0) return log_oom(); - printf("%s [OPTIONS...] COMMAND ...\n" + printf("%1$s [OPTIONS...] COMMAND ...\n" "\n" - "%sSend control commands to the network name resolution manager, or%s\n" - "%sresolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%s\n" - "\nCommands:\n" + "%5$sSend control commands to the network name resolution manager, or%6$s\n" + "%5$sresolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%6$s\n" + "\n%3$sCommands:%4$s\n" " query HOSTNAME|ADDRESS... Resolve domain names, IPv4 and IPv6 addresses\n" " service [[NAME] TYPE] DOMAIN Resolve service (SRV)\n" " openpgp EMAIL@DOMAIN... Query OpenPGP public key\n" @@ -3322,7 +3322,7 @@ static int native_help(void) { " nta [LINK [DOMAIN...]] Get/set per-interface DNSSEC NTA\n" " revert LINK Revert per-interface configuration\n" " log-level [LEVEL] Get/set logging threshold for systemd-resolved\n" - "\nOptions:\n" + "\n%3$sOptions:%4$s\n" " -h --help Show this help\n" " --version Show package version\n" " --no-pager Do not pipe output into a pager\n" @@ -3351,13 +3351,13 @@ static int native_help(void) { " --json=MODE Output as JSON\n" " -j Same as --json=pretty on tty, --json=short\n" " otherwise\n" - "\nSee the %s for details.\n", + "\nSee the %2$s for details.\n", program_invocation_short_name, - ansi_highlight(), + link, + ansi_underline(), ansi_normal(), ansi_highlight(), - ansi_normal(), - link); + ansi_normal()); return 0; } -- 2.47.3