[PATCH:xev 2/2] Add -version option to print program version

Alan Coopersmith alan.coopersmith at oracle.com
Wed Nov 27 18:41:49 PST 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 man/xev.man |    4 ++++
 xev.c       |    3 +++
 2 files changed, 7 insertions(+)

diff --git a/man/xev.man b/man/xev.man
index f40b81d..4edec10 100644
--- a/man/xev.man
+++ b/man/xev.man
@@ -6,6 +6,7 @@ xev - print contents of X events
 [\-display \fIdisplayname\fP] [\-geometry \fIgeom\fP]
 [\-bw \fIpixels\fP] [\-bs \fI{NotUseful,WhenMapped,Always}\fP]
 [\-id \fIwindowid\fP] [\-root] [\-s] [\-name \fIstring\fP] [\-rv]
+[\-version]
 [\-event \fIevent_mask\fP [\-event \fIevent_mask\fP ...]]
 .SH DESCRIPTION
 .PP
@@ -62,6 +63,9 @@ option can be specified multiple times to select multiple types of events.
 When not specified, all events are selected.
 Available event masks: keyboard mouse expose visibility structure substructure
 focus property colormap owner_grab_button randr
+.TP 8
+.B \-version
+This option prints the program version and exits.
 .SH "SEE ALSO"
 X(__miscmansuffix__), xwininfo(__appmansuffix__), xdpyinfo(__appmansuffix__), Xlib Programmers Manual, X Protocol
 Specification
diff --git a/xev.c b/xev.c
index 9afec4a..45c283f 100644
--- a/xev.c
+++ b/xev.c
@@ -1086,6 +1086,9 @@ main (int argc, char **argv)
 		    usage (NULL);
 		event_mask_specified = True;
 		continue;
+	      case 'v':
+		puts(PACKAGE_STRING);
+		exit(0);
 	      default:
 		goto unrecognized;
 	    }				/* end switch on - */
-- 
1.7.9.2



More information about the xorg-devel mailing list