diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-07-15 18:02:33 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-07-18 17:13:24 -0700 |
commit | 8093ecf2ecd112914b9399bab0c413369c9057ca (patch) | |
tree | 17d69361084dde1d19fa0847a8b745e4cc1cc2cc | |
parent | 03050fcce76cd3238f1cd15fb2f2298abda53727 (diff) |
Give better error for "xset dpms force" without argument
Changes from "xset: unknown option force" to
"xset: missing argument to dpms force"
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | xset.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -555,8 +555,9 @@ main(int argc, char *argv[]) DPMSEnable(dpy); DPMSSetTimeouts(dpy, standby_timeout, suspend_timeout, off_timeout); - } else if (i + 1 < argc && strcmp(arg, "force") == 0) { - i++; + } else if (strcmp(arg, "force") == 0) { + if (++i >= argc) + usage("missing argument to dpms force", NULL); arg = argv[i]; /* * The calls to usleep below are necessary to |