[VDPAU] [PATCH] vdpauinfo: add option processing
Stephen Warren
swarren at nvidia.com
Tue Sep 2 09:44:34 PDT 2014
Aaron Plattner wrote at Thursday, August 28, 2014 11:28 AM:
> Add a rudimentary option parser. Parse the options --display and --screen, to
> specify the argument to XOpenDisplay and the screen within the X display to use,
> respectively.
> diff --git a/vdpauinfo.cpp b/vdpauinfo.cpp
> +static void usage(const char *argv0)
> +{
> + printf("Usage: %s [-display displayname] [-screen screen_number]\n", argv0);
> + printf(" --display displayname Server to query\n");
> + printf(" --screen screen_number X screen to query\n");
> + printf(" --help Print this help text\n");
The command-line example says - but the lines below say --.
> +static struct Options parse_options(int argc, char **argv)
> + else if(strcmp(arg, "--help") == 0)
> + {
> + usage(argv[0]);
Supporting -h too might be nice; I always find it annoying when I use -h only to find I have to re-run with --help.
Otherwise,
Reviewed-by: Stephen Warren <swarren at nvidia.com>
--
nvpublic
More information about the VDPAU
mailing list