[PATCH NOTFINISHED 1/4] compositor: take argument for opening xserver display connection

David A Benjamin davidben at MIT.EDU
Thu Aug 4 14:03:31 PDT 2011


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.

David


More information about the wayland-devel mailing list