summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-28 10:34:11 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-28 10:35:00 -0800
commited933c78bf1208140baf6103dc5ab81080f6c6fb (patch)
treeb14c54d54243dee2eb0fe3986b9100ff382c4909
parentfe643332c824fdd0e4f8243e5c1e67c6370d0e5a (diff)
Add -version option
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xbiff.man3
-rw-r--r--xbiff.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/man/xbiff.man b/man/xbiff.man
index 739b362..f98c308 100644
--- a/man/xbiff.man
+++ b/man/xbiff.man
@@ -77,6 +77,9 @@ is loudest).
.B \-shape
This option indicates that the mailbox window should be shaped if masks for
the empty or full images are given.
+.TP 8
+.B \-version
+This option indicates that \fIxbiff\fP should print its version and exit.
.PP
The following standard X Toolkit command line arguments are commonly used with
.I xbiff:
diff --git a/xbiff.c b/xbiff.c
index 46f4550..e833a2e 100644
--- a/xbiff.c
+++ b/xbiff.c
@@ -80,7 +80,8 @@ static void Usage (void)
" -bg color background color\n"
" -fg color foreground color\n"
" -rv reverse video\n"
-" -shape shape the window\n";
+" -shape shape the window\n"
+" -version print version info and exit\n";
fprintf (stderr, "usage: %s [-options ...]\n", ProgramName);
fprintf (stderr, "%s\n", help_message);
@@ -100,6 +101,10 @@ main (int argc, char **argv)
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 ();
/*