diff options
-rw-r--r-- | main.c | 17 | ||||
-rw-r--r-- | man/xman.man | 4 |
2 files changed, 21 insertions, 0 deletions
@@ -151,6 +151,23 @@ main(int argc, char **argv) XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); + /* Handle args that don't require opening a display */ + for (int i = 1; i < argc; i++) { + const char *arg = argv[i]; + /* accept single or double dash for -help & -version */ + if (arg[0] == '-' && arg[1] == '-') { + arg++; + } + if (strcmp(arg, "-help") == 0) { + ArgError(0, NULL); + exit(0); + } + if (strcmp(arg, "-version") == 0) { + puts(PACKAGE_STRING); + exit(0); + } + } + initial_widget = XtAppInitialize(&app_con, "Xman", xman_options, XtNumber(xman_options), &argc, argv, fallback_resources, NULL, ZERO); diff --git a/man/xman.man b/man/xman.man index d18e7f0..62baad9 100644 --- a/man/xman.man +++ b/man/xman.man @@ -40,6 +40,10 @@ Starts without the Top Menu with the three buttons in it. Sets the size and location of the Top Menu with the three buttons in it. .IP "\fB\-pagesize\fP \fIWxH+X+Y\fP" Sets the size and location of all the Manual Pages. +.IP "\fB\-help\fP" +Print a usage message and exit. +.IP "\fB\-version\fP" +Print the program version and exit. .SH "CUSTOMIZING XMAN" .PP .I Xman |