summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2014-08-08 12:59:58 -0700
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-08-19 12:21:44 +0300
commitbb0bb9ce9684a979ea4ccc579a9f0dccf22c745f (patch)
treef6bacc30166dd45beec8e28131f7120096ad5f40
parent6fd10c6c6cecc9416d91a96056eb83115c801ee6 (diff)
downloadweston-bb0bb9ce9684a979ea4ccc579a9f0dccf22c745f.tar.gz
weston-bb0bb9ce9684a979ea4ccc579a9f0dccf22c745f.tar.bz2
weston-bb0bb9ce9684a979ea4ccc579a9f0dccf22c745f.zip
weston-editor --help works
-rw-r--r--clients/editor.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/clients/editor.c b/clients/editor.c
index 08d12036..66cba0b1 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;
}
}