diff options
-rw-r--r-- | xstdcmap.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -341,6 +341,22 @@ main(int argc, char *argv[]) else program_name = *argv; + /* Handle args that don't require opening a display or initializing Xrm */ + for (int n = 1; n < argc; n++) { + const char *argn = argv[n]; + /* accept single or double dash for -help & -version */ + if (argn[0] == '-' && argn[1] == '-') { + argn++; + } + if (strcmp(argn, "-help") == 0) { + usage(0); + } + if (strcmp(argn, "-version") == 0) { + puts(PACKAGE_STRING); + exit(0); + } + } + parse(argc, argv); if (help) { |