weston-editor --help works
authorBill Spitzak <spitzak@gmail.com>
Fri, 8 Aug 2014 19:59:58 +0000 (12:59 -0700)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 19 Aug 2014 09:21:44 +0000 (12:21 +0300)
clients/editor.c

index 08d1203..66cba0b 100644 (file)
@@ -1331,11 +1331,16 @@ main(int argc, char *argv[])
        for (i = 1; i < argc; i++) {
                if (strcmp("--click-to-show", argv[i]) == 0)
                        click_to_show = 1;
-               else if (strcmp("--preferred-language", argv[i]) == 0) {
-                       if (i + 1 < argc) {
-                               preferred_language = argv[i + 1];
-                               i++;
-                       }
+               else if (strcmp("--preferred-language", argv[i]) == 0 &&
+                        i + 1 < argc) {
+                       preferred_language = argv[i + 1];
+                       i++;
+               } else {
+                       printf("Usage: %s [OPTIONS]\n"
+                              "  --click-to-show\n"
+                              "  --preferred-language LANGUAGE\n",
+                              argv[0]);
+                       return 1;
                }
        }