compositor: print usage to stdout on success (not stderr)
authorPeter Hutterer <peter.hutterer@who-t.net>
Sun, 10 Jun 2018 23:57:06 +0000 (09:57 +1000)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 11 Jun 2018 13:21:46 +0000 (16:21 +0300)
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@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
compositor/main.c

index e84857f7ccbe590adb5bcf681e4e8c1e5b689db1..93f92fdccd4f6fe176be2dabed342c105283fc2d 100644 (file)
@@ -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"