[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/2] storage-daemon: report unexpected arguments on the fl
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 1/2] storage-daemon: report unexpected arguments on the fly |
Date: |
Mon, 1 Mar 2021 09:38:11 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 3/1/21 9:28 AM, Paolo Bonzini wrote:
> If the first character of optstring is '-', then each nonoption argv
> element is handled as if it were the argument of an option with character
> code 1. This removes the reordering of the argv array, and enables usage
> of loc_set_cmdline to provide better error messages.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> storage-daemon/qemu-storage-daemon.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
Nice. The man page for 'getopt_long' is unclear whether setting
POSIXLY_CORRECT in the environment would break this (that is, setting
POSIXLY_CORRECT has the same effect as a leading '+'; but you can't have
both leading '+' and leading '-' and when both are set, it is not clear
which one wins). But that's a corner case that I don't think will ever
bite us in real life.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org