summaryrefslogtreecommitdiff
path: root/clients/dnd.c
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2014-08-08 12:59:57 -0700
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-08-19 12:21:37 +0300
commit6fd10c6c6cecc9416d91a96056eb83115c801ee6 (patch)
tree4dde5fcfefffcb3d49622c7bdde6634adcff6d70 /clients/dnd.c
parent36bcf470540ec9741ba64a2a668bd647bd1d9e5c (diff)
downloadweston-6fd10c6c6cecc9416d91a96056eb83115c801ee6.tar.gz
weston-dnd --help works
Diffstat (limited to 'clients/dnd.c')
-rw-r--r--clients/dnd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/clients/dnd.c b/clients/dnd.c
index 620cfff2..956c3064 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -652,7 +652,14 @@ main(int argc, char *argv[])
{
struct display *d;
struct dnd *dnd;
- int i;
+ int self_only = 0;
+
+ if (argc == 2 && !strcmp(argv[1], "--self-only"))
+ self_only = 1;
+ else if (argc > 1) {
+ printf("Usage: %s [OPTIONS]\n --self-only\n", argv[0]);
+ return 1;
+ }
d = display_create(&argc, argv);
if (d == NULL) {
@@ -661,10 +668,8 @@ main(int argc, char *argv[])
}
dnd = dnd_create(d);
-
- for (i = 1; i < argc; i++)
- if (strcmp("--self-only", argv[i]) == 0)
- dnd->self_only = 1;
+ if (self_only)
+ dnd->self_only = 1;
display_run(d);