summaryrefslogtreecommitdiff
path: root/xdriinfo.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-26 23:15:30 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-26 23:16:02 -0800
commit70c75b22f4dee883941495e8dbc6dfa58c1991dd (patch)
tree13057168f7babfeb33a0fa0a3f2d9170a553448d /xdriinfo.c
parent3bac938bf49e6e543ffeaf7bbc0e6c17f5b30416 (diff)
Add -version option to print program version
Add both -version & -display to man page, since options were not previously documented. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xdriinfo.c')
-rw-r--r--xdriinfo.c9
1 files changed, 8 insertions, 1 deletions
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]);