qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 5/6] qemu-img: move common options parsing befor


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH 5/6] qemu-img: move common options parsing before commands processing
Date: Mon, 13 Jun 2016 13:44:28 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/13/2016 10:58 AM, Denis V. Lunev wrote:
> This is necessary to enable creation of common qemu-img options which will
> be specified before command.
> 
> The patch also enables '-V' alias to '--version' (exactly like in other
> block utilities) and documents this change.
> 
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Eric Blake <address@hidden>
> CC: Paolo Bonzini <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> CC: Kevin Wolf <address@hidden>
> ---
>  qemu-img.c    | 39 ++++++++++++++++++++++++++-------------
>  qemu-img.texi | 10 +++++++++-
>  2 files changed, 35 insertions(+), 14 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 4b56ad3..d22ebdf 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -87,9 +87,12 @@ static void QEMU_NORETURN help(void)
>  {
>      const char *help_msg =
>             QEMU_IMG_VERSION
> -           "usage: qemu-img command [command options]\n"
> +           "usage: qemu-img [standard options] command [command options]\n"
>             "QEMU disk image utility\n"
>             "\n"
> +           "    '-h', '--help'       display this help and exit\n"
> +           "    '-V', '--version'    output version information and exit\n"
> +           "\n"
>             "Command syntax:\n"
>  #define DEF(option, callback, arg_string)        \
>             "  " arg_string "\n"
> @@ -3476,7 +3479,7 @@ int main(int argc, char **argv)
>      int c;
>      static const struct option long_options[] = {
>          {"help", no_argument, 0, 'h'},
> -        {"version", no_argument, 0, 'v'},
> +        {"version", no_argument, 0, 'V'},

I guess it doesn't hurt to change to '-V', since neither '-v' nor '-V'
worked prior to the patch.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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