option: Make option help nicer to read
commit638987127db0e3b0c23e86cb9dcc19f988d84be4
authorMax Reitz <mreitz@redhat.com>
Fri, 19 Oct 2018 16:49:25 +0000 (19 18:49 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Nov 2018 14:17:48 +0000 (5 15:17 +0100)
treef4e650660576de7287f165a6bf39ada585a12c79
parent36f808fa15f85a894c2f6cce9df46d27e8f0f129
option: Make option help nicer to read

This adds some whitespace into the option help (including indentation)
and puts angle brackets around the type names.  Furthermore, the list
name is no longer printed as part of every line, but only once in
advance, and only if the caller did not print a caption already.

This patch also restores the description alignment we had before commit
9cbef9d68ee1d8d0, just at 24 instead of 16 characters like we used to.
This increase is because now we have the type and two spaces of
indentation before the description, and with a usual type name length of
three chracters, this sums up to eight additional characters -- which
means that we now need 24 characters to get the same amount of padding
for most options.  Also, 24 is a third of 80, which makes it kind of a
round number in terminal terms.

Finally, this patch amends the reference output of iotest 082 to match
the changes (and thus makes it pass again).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/qemu/option.h
qemu-img.c
tests/qemu-iotests/082.out
util/qemu-option.c