From 353b2baa20c5a643c3de1eeee963f8a46af90feb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 15 Nov 2019 18:38:44 +0100 Subject: tree-wide: clean up --help texts a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cleans up and unifies the outut of --help texts a bit: 1. Highlight the human friendly description string, not the command line via ANSI sequences. Previously both this description string and the brief command line summary was marked with the same ANSI highlight sequence, but given we auto-page to less and less does not honour multi-line highlights only the command line summary was affectively highlighted. Rationale: for highlighting the description instead of the command line: the command line summary is relatively boring, and mostly the same for out tools, the description on the other hand is pregnant, important and captions the whole thing and hence deserves highlighting. 2. Always suffix "Options" with ":" in the help text 3. Rename "Flags" → "Options" in one case 4. Move commands to the top in a few cases 5. add coloring to many more help pages 6. Unify on COMMAND instead of {COMMAND} in the command line summary. Some tools did it one way, others the other way. I am not sure what precisely {} is supposed to mean, that uppercasing doesn't, hence let's simplify and stick to the {}-less syntax And minor other tweaks. --- src/hwdb/hwdb.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/hwdb') diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index b069a3eb8a..651647b3f0 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -9,6 +9,7 @@ #include "main-func.h" #include "pretty-print.h" #include "selinux-util.h" +#include "terminal-util.h" #include "util.h" #include "verbs.h" @@ -32,18 +33,21 @@ static int help(void) { if (r < 0) return log_oom(); - printf("%s OPTIONS COMMAND\n\n" - "Update or query the hardware database.\n\n" + printf("%s [OPTIONS...] COMMAND ...\n\n" + "%sUpdate or query the hardware database.%s\n" + "\nCommands:\n" + " update Update the hwdb database\n" + " query MODALIAS Query database and print result\n" + "\nOptions:\n" " -h --help Show this help\n" " --version Show package version\n" " -s --strict When updating, return non-zero exit value on any parsing error\n" " --usr Generate in " UDEVLIBEXECDIR " instead of /etc/udev\n" " -r --root=PATH Alternative root path in the filesystem\n\n" - "Commands:\n" - " update Update the hwdb database\n" - " query MODALIAS Query database and print result\n" "\nSee the %s for details.\n" , program_invocation_short_name + , ansi_highlight() + , ansi_normal() , link ); -- cgit v1.2.1