summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-31 23:20:51 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-31 23:20:51 -0700
commitde4d0b6138f35acd12d1206cdd292376418a02c1 (patch)
tree5b4bed210d2187aa390aea21605c2b89988a40a9
parenta0b3cf16cdd208ca9b0c86631999df047cbe8817 (diff)
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xlsfonts.man4
-rw-r--r--xlsfonts.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/man/xlsfonts.man b/man/xlsfonts.man
index 620464e..834ea60 100644
--- a/man/xlsfonts.man
+++ b/man/xlsfonts.man
@@ -66,6 +66,10 @@ systems).
.TP
\fB\-fn \fIpattern\fB\fR
This option specifies the font name pattern to match.
+.TP
+.B -v
+This option indicates that xlsfonts should print out the program version
+and exit.
.SH "SEE ALSO"
\fBX\fR(__miscmansuffix__), \fBXserver\fR(__appmansuffix__), \fBxset\fR(__appmansuffix__), \fBxfd\fR(__appmansuffix__), X Logical Font Description Conventions
.SH ENVIRONMENT
diff --git a/xlsfonts.c b/xlsfonts.c
index 0f45450..21bccc6 100644
--- a/xlsfonts.c
+++ b/xlsfonts.c
@@ -26,6 +26,10 @@ in this Software without prior written authorization from The Open Group.
* */
/* $XFree86: xc/programs/xlsfonts/xlsfonts.c,v 1.9 2003/09/08 14:25:33 eich Exp $ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
@@ -90,6 +94,7 @@ void usage(const char *errmsg)
" -n columns number of columns if multi column\n"
" -display displayname X server to contact\n"
" -d displayname (alias for -display displayname)\n"
+ " -v print program version\n"
"\n");
Close_Display();
exit(EXIT_FAILURE);
@@ -149,6 +154,9 @@ int main(int argc, char **argv)
case 'u':
sort_output = False;
break;
+ case 'v':
+ puts(PACKAGE_STRING);
+ exit(0);
default:
fprintf (stderr, "%s: unrecognized argument -%c\n\n",
program_name, argv[0][i]);