diff options
-rw-r--r-- | xbiff.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -99,12 +99,21 @@ main (int argc, char **argv) XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); + /* Handle args that don't require opening a display */ + for (int n = 1; n < argc; n++) { + const char *argn = argv[n]; + /* accept single or double dash for -version */ + if (argn[0] == '-' && argn[1] == '-') { + argn++; + } + if (strcmp(argn, "-version") == 0) { + puts(PACKAGE_STRING); + exit(0); + } + } + toplevel = XtAppInitialize(&xtcontext, "XBiff", options, XtNumber (options), &argc, argv, NULL, NULL, 0); - if (argc == 2 && strcmp(argv[1], "-version") == 0) { - puts(PACKAGE_STRING); - exit(0); - } if (argc != 1) Usage (); /* |