qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
Date: Mon, 13 Aug 2018 18:36:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-08-03 02:50, John Arbuckle wrote:
> Add an examples section to the help output.
> 
> Signed-off-by: John Arbuckle <address@hidden>
> ---
>  qemu-img.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 1acddf693c..f77c82695d 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -199,6 +199,17 @@ static void QEMU_NORETURN help(void)
>  
>      printf("%s\nSupported formats:", help_msg);
>      bdrv_iterate_format(format_print, NULL);
> +
> +    printf("\n\nExamples:\n\n"
> +           "Create: qemu-img create -f qcow2 image.qcow2 10G\n\n"
> +           "Info: qemu-img info image.qcow2\n\n"
> +           "Resize: qemu-img resize image.qcow2 20G\n\n"
> +           "Convert: qemu-img convert -f raw -O qcow2 image.img 
> image.qcow2\n\n"
> +           "Check: qemu-img check image.qcow2\n\n"
> +           "Map: qemu-img map -f qcow2 --output=human image.qcow2\n\n"
> +           "Rebase: qemu-img rebase -b new_backing_file.qcow2 image.qcow2"
> +           );
> +

The examples look good!

I have to agree with Fam, though, that since all the rest of the help
text is rather dense, this should be condensed as well.  I would vote
for replacing all \n\n" by \n" and indenting the example lines by two
spaces.

(I personally am a fan of not-so-dense info, but then again, this is a
--help text, so there is a point in making it dense.)

Also, I think it would be better to order the examples alphabetically.

Max

>      printf("\n\n" QEMU_HELP_BOTTOM "\n");
>      exit(EXIT_SUCCESS);
>  }
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]