[virt-tools-list] [vhostmd] Fix help option

Richard W.M. Jones rjones at redhat.com
Fri Jul 6 13:02:25 UTC 2018


On Wed, Jun 20, 2018 at 04:40:58PM -0600, Jim Fehlig wrote:
> Fix the short option for help, add help to the help output, and
> add help to the vhostmd man page.
> 
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>

This one's gone upstream already I think, but ACK anyway.

Are we going to do a new upstream release soon?

Rich.

>  docs/man/vhostmd.8 | 3 +++
>  vhostmd/vhostmd.c  | 7 ++++---
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/man/vhostmd.8 b/docs/man/vhostmd.8
> index 2c73adc..ed82432 100644
> --- a/docs/man/vhostmd.8
> +++ b/docs/man/vhostmd.8
> @@ -13,6 +13,9 @@ provides a "metrics communication channel" between a host and its hosted virtual
>  vhostmd will periodically write metrics to a disk.  The metrics to write, how often, and where to write them are all adjustable via the /etc/vhostmd/vhostmd.conf configuration file.  The disk can then be surfaced read-only to virtual machines using tools provided by the host's virtualization platform.
>  .SH OPTIONS
>  .TP
> +.B \-h, --help
> +Display help and exit
> +.TP
>  .B \-v, --verbose
>  Verbose messages
>  .TP
> diff --git a/vhostmd/vhostmd.c b/vhostmd/vhostmd.c
> index 7f04705..8576609 100644
> --- a/vhostmd/vhostmd.c
> +++ b/vhostmd/vhostmd.c
> @@ -950,6 +950,7 @@ static void usage(const char *argv0)
>     %s [options]\n\
>     \n\
>     Options:\n\
> +   -h | --help            Display program help.\n\
>     -v | --verbose         Verbose messages.\n\
>     -c | --connect <uri>   Set the libvirt URI.\n\
>     -d | --no-daemonize    Process will not daemonize - useful for debugging.\n\
> @@ -980,7 +981,7 @@ int main(int argc, char *argv[])
>        { "pid-file", required_argument, NULL, 'p'},
>        { "user", required_argument, NULL, 'u'},
>        { "connect", required_argument, NULL, 'c'},
> -      { "help", no_argument, NULL, '?' },
> +      { "help", no_argument, NULL, 'h' },
>        {0, 0, 0, 0}
>     };
>  
> @@ -988,7 +989,7 @@ int main(int argc, char *argv[])
>        int optidx = 0;
>        int c;
>  
> -      c = getopt_long(argc, argv, "c:df:p:u:v", opts, &optidx);
> +      c = getopt_long(argc, argv, "c:df:p:u:vh", opts, &optidx);
>  
>        if (c == -1)
>           break;
> @@ -1015,7 +1016,7 @@ int main(int argc, char *argv[])
>           case 'c':
>  	    libvirt_uri = optarg;
>  	    break;
> -         case '?':
> +         case 'h':
>              usage(argv[0]);
>              return 2;
>           default:
> -- 
> 2.17.1
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the virt-tools-list mailing list