[PATCH weston 3/3] compositor: print usage to stdout on success (not stderr)
Pekka Paalanen
ppaalanen at gmail.com
Mon Jun 11 13:30:49 UTC 2018
On Mon, 11 Jun 2018 16:26:33 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Mon, 11 Jun 2018 09:57:06 +1000
> Peter Hutterer <peter.hutterer at who-t.net> wrote:
>
> > Triggered by weston --help, the usage() output should not look like an error.
> >
> > Note that there is only one caller of usage() at the moment, but let's handle
> > this here based on the status in case we add other cases.
> >
> > https://gitlab.freedesktop.org/wayland/weston/issues/112
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > compositor/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/compositor/main.c b/compositor/main.c
> > index e84857f7..93f92fdc 100644
> > --- a/compositor/main.c
> > +++ b/compositor/main.c
> > @@ -438,7 +438,7 @@ verify_xdg_runtime_dir(void)
> > static int
> > usage(int error_code)
> > {
> > - fprintf(stderr,
> > + fprintf(error_code == EXIT_SUCCESS ? stdout : stderr,
> > "Usage: weston [OPTIONS]\n\n"
> > "This is weston version " VERSION ", the Wayland reference compositor.\n"
> > "Weston supports multiple backends, and depending on which backend is in use\n"
>
> Hi Peter,
>
> patches 1 and 3 are good, pushed those:
> dcfb1958..70e8a32f master -> master
>
Erm, when I checked if the bug was actually fixed, I noticed that
usage() does many fprintf() calls and this fixed only the first one.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180611/2779e989/attachment.sig>
More information about the wayland-devel
mailing list