From bb0bb9ce9684a979ea4ccc579a9f0dccf22c745f Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Fri, 8 Aug 2014 12:59:58 -0700 Subject: [PATCH] weston-editor --help works --- clients/editor.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index 08d1203..66cba0b 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -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; } } -- 2.7.4