tree-wide: clean up --help texts a bit
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
ce0d4c4f91
commit
353b2baa20
@@ -2690,9 +2690,9 @@ static int help(int argc, char *argv[], void *userdata) {
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
|
||||
"Send control commands to or query the virtual machine and container\n"
|
||||
"registration manager.%s\n"
|
||||
printf("%s [OPTIONS...] COMMAND ...\n\n"
|
||||
"%sSend control commands to or query the virtual machine and container%s\n"
|
||||
"%sregistration manager.%s\n"
|
||||
"\nMachine Commands:\n"
|
||||
" list List running VMs and containers\n"
|
||||
" status NAME... Show VM/container details\n"
|
||||
@@ -2732,7 +2732,7 @@ static int help(int argc, char *argv[], void *userdata) {
|
||||
" export-raw NAME [FILE] Export a RAW container or VM image locally\n"
|
||||
" list-transfers Show list of downloads in progress\n"
|
||||
" cancel-transfer Cancel a download\n"
|
||||
"\nOptions\n"
|
||||
"\nOptions:\n"
|
||||
" -h --help Show this help\n"
|
||||
" --version Show package version\n"
|
||||
" --no-pager Do not pipe output into a pager\n"
|
||||
@@ -2762,8 +2762,10 @@ static int help(int argc, char *argv[], void *userdata) {
|
||||
" checksum, signature)\n"
|
||||
" --force Download image even if already exists\n"
|
||||
"\nSee the %s for details.\n"
|
||||
, ansi_highlight()
|
||||
, program_invocation_short_name
|
||||
, ansi_highlight()
|
||||
, ansi_normal()
|
||||
, ansi_highlight()
|
||||
, ansi_normal()
|
||||
, link
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user