diff options
-rw-r--r-- | xsm.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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"); |