summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-03 15:57:06 -0700
committerSung-Jin Park <sj76.park@samsung.com>2013-09-03 00:03:04 -0400
commitceb9ca2464fbbdf84e457b4c3841403f1794209c (patch)
treea02f38e0994ea61a52fb8de9482a382613714965
parent58ab9f0af6a055641f66af19666b4d3b8bda9b05 (diff)
downloadxkill-ceb9ca2464fbbdf84e457b4c3841403f1794209c.tar.gz
xkill-ceb9ca2464fbbdf84e457b4c3841403f1794209c.tar.bz2
xkill-ceb9ca2464fbbdf84e457b4c3841403f1794209c.zip
Add -version option to print version
Change-Id: I9b4703c54ddefb2011f321bf0e159a60f94e2b97 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xkill.man5
-rw-r--r--xkill.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/man/xkill.man b/man/xkill.man
index 87ddc0d..a283f34 100644
--- a/man/xkill.man
+++ b/man/xkill.man
@@ -27,7 +27,7 @@
xkill - kill a client by its X resource
.SH SYNOPSIS
.B "xkill"
-[\-display \fIdisplayname\fP] [\-id \fIresource\fP] [\-button number] [\-frame] [\-all]
+[\-display \fIdisplayname\fP] [\-id \fIresource\fP] [\-button number] [\-frame] [\-all] [\-version]
.SH DESCRIPTION
.PP
.I Xkill
@@ -66,6 +66,9 @@ This option indicates that xkill should ignore the standard conventions for
finding top-level client windows (which are typically nested inside a window
manager window), and simply believe that you want to kill direct children of
the root.
+.TP 8
+.B \-version
+This option makes xkill print its version and exit without killing anything.
.SH CAVEATS
This command does not provide any warranty that the application whose
connection to the X server is closed will abort nicely, or even abort
diff --git a/xkill.c b/xkill.c
index 5a303b7..a4f5c48 100644
--- a/xkill.c
+++ b/xkill.c
@@ -35,6 +35,10 @@ from The Open Group.
* Warning, this is a very dangerous client....
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -78,6 +82,7 @@ usage(void)
" -frame don't ignore window manager frames\n"
" -button number specific button to be pressed to select window\n"
" -all kill all clients with top level windows\n"
+" -version print version and exit\n"
"\n";
fprintf (stderr, "usage: %s [-option ...]\n%s",
@@ -129,6 +134,9 @@ main(int argc, char *argv[])
case 'a': /* -all */
kill_all = True;
continue;
+ case 'v':
+ puts(PACKAGE_STRING);
+ exit(0);
default:
usage ();
}