diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-06-01 21:00:47 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-06-01 21:00:47 -0700 |
commit | 5f369174777783fb9544b81cfdfab255d7e990a8 (patch) | |
tree | a9fa3ae75446c5e65e6bfab8986d3eca88344ffa | |
parent | 007a72af45ea48e3ed5e750b4b39e034b102d2c0 (diff) |
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xpr.c | 13 | ||||
-rw-r--r-- | xpr.man | 4 |
2 files changed, 17 insertions, 0 deletions
@@ -71,6 +71,10 @@ from the X Consortium. * */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <X11/Xos.h> #include <X11/Xfuncs.h> #include <X11/Xlib.h> @@ -511,6 +515,7 @@ usage(void) " -scale <scale>\n" " -slide\n" " -split <n-pages>\n" + " -version\n" ); exit(EXIT_FAILURE); } @@ -772,6 +777,14 @@ void parse_args( unknown_arg(arg); break; + case 'v': /* -version */ + if (strcmp(*argv, "-version") == 0) { + puts(PACKAGE_STRING); + exit(0); + } else + unknown_arg(arg); + break; + case 'w': /* -width <inches> */ if (!bcmp(*argv, "-width", len)) { argc--; argv++; @@ -70,6 +70,8 @@ xpr \- print an X window dump ] [ .B \-slide ] [ +.B \-version +] [ .I filename ] .SH DESCRIPTION @@ -207,6 +209,8 @@ are available. .IP "\fB\-slide\fP" This option allows overhead transparencies to be printed using the PaintJet and PaintJet XL printers. +.IP "\fB\-version\fP" +This option prints the program version information and exits. .SH SEE ALSO xwd(1), xwud(1), X(1) |