summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/xdriinfo.man10
-rw-r--r--xdriinfo.c9
2 files changed, 17 insertions, 2 deletions
diff --git a/man/xdriinfo.man b/man/xdriinfo.man
index 75b9fc0..ec63d1d 100644
--- a/man/xdriinfo.man
+++ b/man/xdriinfo.man
@@ -4,12 +4,20 @@
xdriinfo \- query configuration information of DRI drivers
.SH SYNOPSIS
.B xdriinfo
-[\-display \fIdisplayname\fP] [command]
+[\-display \fIdisplayname\fP] [-version] [command]
.SH DESCRIPTION
\fIxdriinfo\fP can be used to query configuration information of
direct rendering drivers. If no command argument is specified it lists
the names of the direct rendering drivers for all screens.
.PP
+Valid options are:
+.TP
+.B -display
+Specifies X server to connect to.
+.TP
+.B -version
+Print the program version and exit.
+.PP
Valid commands are:
.TP
.B nscreens
diff --git a/xdriinfo.c b/xdriinfo.c
index 9118ea9..c23cfa1 100644
--- a/xdriinfo.c
+++ b/xdriinfo.c
@@ -22,6 +22,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#include <GL/glxext.h>
@@ -44,7 +48,7 @@ void printUsage (void);
void printUsage (void) {
fprintf (stderr,
-"Usage: xdriinfo [-display <dpy>] [command]\n"
+"Usage: xdriinfo [-display <dpy>] [-version] [command]\n"
"Commands:\n"
" nscreens print the number of screens on display\n"
" driver screen print the DRI driver name of screen\n"
@@ -79,6 +83,9 @@ int main (int argc, char *argv[]) {
} else if (!strcmp (argv[i], "options")) {
func = OPTIONS;
argPtr = &funcArg;
+ } else if (!strcmp (argv[i], "-version")) {
+ puts(PACKAGE_STRING);
+ return 0;
} else {
fprintf (stderr, "%s: unrecognized argument '%s'\n",
argv[0], argv[i]);