[PATCH 05/11] Made weston-screensaver --help work

Bill Spitzak spitzak at gmail.com
Tue Jul 8 21:17:08 PDT 2014


---
 clients/wscreensaver.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/clients/wscreensaver.c b/clients/wscreensaver.c
index 47f6c8a..f75d0d8 100644
--- a/clients/wscreensaver.c
+++ b/clients/wscreensaver.c
@@ -310,8 +310,12 @@ int main(int argc, char *argv[])
 
 	init_frand();
 
-	parse_options(wscreensaver_options,
-		      ARRAY_LENGTH(wscreensaver_options), &argc, argv);
+	if (parse_options(wscreensaver_options,
+			ARRAY_LENGTH(wscreensaver_options), &argc, argv) > 1) {
+		printf("Usage: %s [OPTIONS]\n  --demo for demo mode\n",
+		       argv[0]);
+		exit(1);
+	}
 
 	d = display_create(&argc, argv);
 	if (d == NULL) {
-- 
1.7.9.5



More information about the wayland-devel mailing list