tree-wide: Drop custom formatting for print() help messages

I think this formatting was originally used because it simplified
adding new options to the help messages. However, these days, most
tools their help message end with "\nSee the %s for details.\n" so
the final line almost never has to be edited which eliminates the
benefit of the custom formatting used for printf() help messages.
Let's make things more consistent and use the same formatting for
printf() help messages that we use everywhere else.

Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
This commit is contained in:
Daan De Meyer
2021-01-31 13:14:02 +09:00
committed by Yu Watanabe
parent 16455ee2b1
commit bc556335b1
78 changed files with 335 additions and 370 deletions
+3 -4
View File
@@ -43,10 +43,9 @@ static int resolvconf_help(void) {
"implementations are not supported and will cause the invocation to fail: -u,\n"
"-I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates,\n"
"--updates-are-enabled.\n"
"\nSee the %2$s for details.\n"
, program_invocation_short_name
, link
);
"\nSee the %2$s for details.\n",
program_invocation_short_name,
link);
return 0;
}
+12 -14
View File
@@ -2568,12 +2568,11 @@ static int compat_help(void) {
" --set-dnssec=MODE Set per-interface DNSSEC mode\n"
" --set-nta=DOMAIN Set per-interface DNSSEC NTA\n"
" --revert Revert per-interface configuration\n"
"\nSee the %4$s for details.\n"
, program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link
);
"\nSee the %4$s for details.\n",
program_invocation_short_name,
ansi_highlight(),
ansi_normal(),
link);
return 0;
}
@@ -2627,14 +2626,13 @@ static int native_help(void) {
" (default: yes)\n"
" --raw[=payload|packet] Dump the answer as binary data\n"
" --legend=BOOL Print headers and additional info (default: yes)\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, ansi_highlight()
, ansi_normal()
, link
);
"\nSee the %s for details.\n",
program_invocation_short_name,
ansi_highlight(),
ansi_normal(),
ansi_highlight(),
ansi_normal(),
link);
return 0;
}