Re: [PATCH] Properly handle -h / -V for --help/--version aliases in virtlockd/libvirtd

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

 



On 08/13/2013 05:17 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> The virtlockd/libvirtd daemons had listed '?' as the short option
> for --help. getopt_long uses '?' for any unknown option. We want
> to be able to distinguish unknown options (which use EXIT_FAILURE)
> from correct usage of help (which should use EXIT_SUCCESS). Thus
> we should use 'h' as a short option for --help. Also add this to
> the man page docs
> 
> The virtlockd/libvirtd daemons did not list any short option
> for the --version arg. Add -V as a valid short option, since
> -v is already used for --verbose.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  daemon/libvirtd.c            | 31 ++++++++++++++-----------------
>  daemon/libvirtd.pod.in       |  4 ++++
>  src/locking/lock_daemon.c    | 29 +++++++++++++----------------
>  src/locking/virtlockd.pod.in |  6 +++++-
>  4 files changed, 36 insertions(+), 34 deletions(-)

ACK.

>  
> -enum {
> -    OPT_VERSION = 129
> -};

Good riddance - on single-byte locales, it is actually possible to type
byte 129 (when using a long-only option, you should generally list it
starting from 257, so that it can't be typed as an accidental short
option of some weird character).

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]