[PATCH NOTFINISHED 1/4] compositor: take argument for opening xserver display connection
Tiago Vignatti
tiago.vignatti at linux.intel.com
Fri Aug 5 02:21:29 PDT 2011
On 08/05/2011 12:03 AM, David A Benjamin wrote:
> On Wed, 3 Aug 2011, Tiago Vignatti wrote:
>
>> Oh boy... I tried for about half-hour to make getopt_long work
>> properly for my
>> desires. I wanted to set 'x' as an optional argument for the
>> compositor, so
>> whenever it is called it takes another argument (the X server display
>> connection) as optional. For example, calling "wayland-compositor",
>> "wayland-compositor -x" or "wayland-compositor -x 2" should all work.
>> For that,
>> man pagetells me that I have to insert two colons (::) after 'x' in the
>> optstring (opts). I tried for awhile but I failed. I guess I'm missing a
>> very basic understanding here of getopt_long usage that my
>> tiredness/dumbness
>> is not helping :/
>>
>> I hope someone could give a help. Thanks!
>
> I believe the argument must be in the same token, so you want -x2 for
> the short version or --xserver=2 for the long version. It does it that
> way so there isn't ambiguity about whether -x -y is passing -y as
> argument or a separate option.
that's pretty much what I got as well, but for me it doesn't make sense.
I double checked the code in glibc and in fact it parses like that.
Anyway, I cooked and sent to the list now a "finished" patch which I
guess is enough for our desires. I appreciate if you take a look.
thanks for checking it, David (and Fernando, who mailed off the list).
Tiago
More information about the wayland-devel
mailing list