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
+5 -6
View File
@@ -42,12 +42,11 @@ static int help(int argc, char *argv[], void *userdata) {
" -h --help Show this help\n"
" --version Print version\n"
" --path=PATH Path to the $BOOT partition (may be used multiple times)\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link
);
"\nSee the %s for details.\n",
program_invocation_short_name,
ansi_highlight(),
ansi_normal(),
link);
return 0;
}
+5 -6
View File
@@ -27,12 +27,11 @@ static int help(void) {
"\n%sVerify system operational state.%s\n\n"
" -h --help Show this help\n"
" --version Print version\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
, ansi_highlight()
, ansi_normal()
, link
);
"\nSee the %s for details.\n",
program_invocation_short_name,
ansi_highlight(),
ansi_normal(),
link);
return 0;
}
+7 -6
View File
@@ -1043,12 +1043,13 @@ static int help(int argc, char *argv[], void *userdata) {
" --no-pager Do not pipe output into a pager\n"
" --graceful Don't fail when the ESP cannot be found or EFI\n"
" variables cannot be written\n"
"\nSee the %2$s for details.\n"
, program_invocation_short_name
, link
, ansi_underline(), ansi_normal()
, ansi_highlight(), ansi_normal()
);
"\nSee the %2$s for details.\n",
program_invocation_short_name,
link,
ansi_underline(),
ansi_normal(),
ansi_highlight(),
ansi_normal());
return 0;
}