summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xset.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/xset.c b/xset.c
index 9c0cf26..36d4b7a 100644
--- a/xset.c
+++ b/xset.c
@@ -168,11 +168,21 @@ main(int argc, char *argv[])
if (++i >= argc)
usage("missing argument to -display");
disp = argv[i];
- } else if (strcmp(arg, "-version") == 0) {
- puts(PACKAGE_STRING);
- exit(EXIT_SUCCESS);
} else {
- hasargs = True;
+ /* accept single or double dash for -help & -version */
+ if (arg[0] == '-' && arg[1] == '-') {
+ arg++;
+ }
+
+ if (strcmp(arg, "-help") == 0) {
+ usage(NULL);
+ }
+ else if (strcmp(arg, "-version") == 0) {
+ puts(PACKAGE_STRING);
+ exit(EXIT_SUCCESS);
+ }
+ else
+ hasargs = True;
}
}
if (!hasargs) {