summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xsm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/xsm.c b/xsm.c
index 2a30717..c02cfbe 100644
--- a/xsm.c
+++ b/xsm.c
@@ -175,12 +175,20 @@ main(int argc, char *argv[])
switch (argv[i][1])
{
case 'd': /* -display */
- if (++i >= argc) goto usage;
+ if (++i >= argc) {
+ fprintf (stderr, "%s: -display requires an argument\n",
+ argv[0]);
+ goto usage;
+ }
cmd_line_display = (char *) XtNewString (argv[i]);
continue;
case 's': /* -session */
- if (++i >= argc) goto usage;
+ if (++i >= argc) {
+ fprintf (stderr, "%s: -session requires an argument\n",
+ argv[0]);
+ goto usage;
+ }
session_name = XtNewString (argv[i]);
continue;
@@ -190,6 +198,8 @@ main(int argc, char *argv[])
}
}
+ fprintf (stderr, "%s: unrecognized argument '%s'\n", argv[0], argv[i]);
+
usage:
fprintf (stderr,
"Usage: xsm [-display display] [-session sessionName] [-verbose]\n");