qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-img.c: Add examples section
@ 2018-08-03  0:50 John Arbuckle
  2018-08-03  2:10 ` Fam Zheng
  2018-08-13 16:36 ` Max Reitz
  0 siblings, 2 replies; 6+ messages in thread
From: John Arbuckle @ 2018-08-03  0:50 UTC (permalink / raw)
  To: kwolf, mreitz, qemu-block, qemu-devel; +Cc: John Arbuckle

Add an examples section to the help output.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 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"
+           );
+
     printf("\n\n" QEMU_HELP_BOTTOM "\n");
     exit(EXIT_SUCCESS);
 }
-- 
2.14.3 (Apple Git-98)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
  2018-08-03  0:50 [Qemu-devel] [PATCH] qemu-img.c: Add examples section John Arbuckle
@ 2018-08-03  2:10 ` Fam Zheng
  2018-08-03  2:34   ` Programmingkid
  2018-08-13 16:36 ` Max Reitz
  1 sibling, 1 reply; 6+ messages in thread
From: Fam Zheng @ 2018-08-03  2:10 UTC (permalink / raw)
  To: John Arbuckle; +Cc: kwolf, mreitz, qemu-block, qemu-devel

On Thu, 08/02 20:50, John Arbuckle wrote:
> Add an examples section to the help output.
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  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 text looks good but maybe it's better to condense the section by using only
one \n between command lines instead of two?

Fam

> +
>      printf("\n\n" QEMU_HELP_BOTTOM "\n");
>      exit(EXIT_SUCCESS);
>  }
> -- 
> 2.14.3 (Apple Git-98)
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
  2018-08-03  2:10 ` Fam Zheng
@ 2018-08-03  2:34   ` Programmingkid
  2018-08-03  8:46     ` Fam Zheng
  0 siblings, 1 reply; 6+ messages in thread
From: Programmingkid @ 2018-08-03  2:34 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, mreitz, qemu-block, qemu-devel


> On Aug 2, 2018, at 10:10 PM, Fam Zheng <famz@redhat.com> wrote:
> 
> On Thu, 08/02 20:50, John Arbuckle wrote:
>> Add an examples section to the help output.
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>> 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 text looks good but maybe it's better to condense the section by using only
> one \n between command lines instead of two?
> 
> Fam

It would be harder on the user's eyes if I did that.

Thank you for reviewing my patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
  2018-08-03  2:34   ` Programmingkid
@ 2018-08-03  8:46     ` Fam Zheng
  2018-08-03 12:40       ` Programmingkid
  0 siblings, 1 reply; 6+ messages in thread
From: Fam Zheng @ 2018-08-03  8:46 UTC (permalink / raw)
  To: Programmingkid; +Cc: kwolf, mreitz, qemu-block, qemu-devel

On Thu, 08/02 22:34, Programmingkid wrote:
> 
> > On Aug 2, 2018, at 10:10 PM, Fam Zheng <famz@redhat.com> wrote:
> > 
> > On Thu, 08/02 20:50, John Arbuckle wrote:
> >> Add an examples section to the help output.
> >> 
> >> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> >> ---
> >> 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 text looks good but maybe it's better to condense the section by using only
> > one \n between command lines instead of two?
> > 
> > Fam
> 
> It would be harder on the user's eyes if I did that.

This is objective, but being compact is more consistent in density with the
above "Command syntax" section in this function.

Fam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
  2018-08-03  8:46     ` Fam Zheng
@ 2018-08-03 12:40       ` Programmingkid
  0 siblings, 0 replies; 6+ messages in thread
From: Programmingkid @ 2018-08-03 12:40 UTC (permalink / raw)
  To: Fam Zheng; +Cc: kwolf, mreitz, qemu-block, qemu-devel


> On Aug 3, 2018, at 4:46 AM, Fam Zheng <famz@redhat.com> wrote:
> 
> On Thu, 08/02 22:34, Programmingkid wrote:
>> 
>>> On Aug 2, 2018, at 10:10 PM, Fam Zheng <famz@redhat.com> wrote:
>>> 
>>> On Thu, 08/02 20:50, John Arbuckle wrote:
>>>> Add an examples section to the help output.
>>>> 
>>>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>>>> ---
>>>> 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 text looks good but maybe it's better to condense the section by using only
>>> one \n between command lines instead of two?
>>> 
>>> Fam
>> 
>> It would be harder on the user's eyes if I did that.
> 
> This is objective, but being compact is more consistent in density with the
> above "Command syntax" section in this function.

I want to break away from that very dense format. It was just too hard to read.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img.c: Add examples section
  2018-08-03  0:50 [Qemu-devel] [PATCH] qemu-img.c: Add examples section John Arbuckle
  2018-08-03  2:10 ` Fam Zheng
@ 2018-08-13 16:36 ` Max Reitz
  1 sibling, 0 replies; 6+ messages in thread
From: Max Reitz @ 2018-08-13 16:36 UTC (permalink / raw)
  To: John Arbuckle, kwolf, qemu-block, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

On 2018-08-03 02:50, John Arbuckle wrote:
> Add an examples section to the help output.
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-13 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-03  0:50 [Qemu-devel] [PATCH] qemu-img.c: Add examples section John Arbuckle
2018-08-03  2:10 ` Fam Zheng
2018-08-03  2:34   ` Programmingkid
2018-08-03  8:46     ` Fam Zheng
2018-08-03 12:40       ` Programmingkid
2018-08-13 16:36 ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).