[VDPAU] [PATCH] vdpauinfo: add option processing
Aaron Plattner
aplattner at nvidia.com
Fri Sep 12 15:00:11 PDT 2014
On 09/02/2014 09:44 AM, Stephen Warren wrote:
> 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 --.
Thanks for catching that. Fixed.
>> +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.
I was basing it on the behavior of programs like "cat -h", but there's
no reason we have to be consistent with that.
> Otherwise,
> Reviewed-by: Stephen Warren <swarren at nvidia.com>
Thanks Stephen. Pushed, with your suggestions applied and the "list
color table formats for queryOutputSurface" TODO item restored:
To ssh://people.freedesktop.org/~aplattner/vdpauinfo
f8f18bf..d53f927 master -> master
More information about the VDPAU
mailing list