diff options
-rw-r--r-- | man/xvinfo.man | 3 | ||||
-rw-r--r-- | xvinfo.c | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/man/xvinfo.man b/man/xvinfo.man index 742157b..75c792c 100644 --- a/man/xvinfo.man +++ b/man/xvinfo.man @@ -17,6 +17,9 @@ This argument allows you to specify the server to query; see \fIX(__miscmansuffi .TP 8 .B "-short" Output less details, to reduce the amount of text. +.TP 8 +.B "-version" +Output program version, then exit. .SH ENVIRONMENT .PP .TP 8 @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <X11/X.h> #include <X11/Xlib.h> #include <X11/extensions/Xvlib.h> @@ -9,7 +13,7 @@ static void _X_NORETURN PrintUsage(void) { - fprintf(stderr, "Usage: xvinfo [-display host:dpy] [-short]\n"); + fprintf(stderr, "Usage: xvinfo [-display host:dpy] [-short] [-version]\n"); exit(0); } @@ -40,6 +44,10 @@ main(int argc, char *argv[]) } else if (!strcmp(argv[i], "-short")) shortmode = 1; + else if (!strcmp(argv[i], "-version")) { + printf("%s\n", PACKAGE_STRING); + exit(0); + } else { PrintUsage(); } |