summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-06-22 10:41:33 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-06-22 16:17:09 +1000
commitcdb8677f370b34a3a523a32ae0023c7e8c0c965c (patch)
treea3eb6d56dd6c9875fb52a9f2b10db3b28c5b7764
parentcef4ba4b8fdc9a5439f71437c08cf690a750bd6b (diff)
Print version number on -version.
This commit isn't playing the WARN/M/M1 macro game. Version numbers to to stdout, full stop. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xkbcomp.man3
-rw-r--r--xkbcomp.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/man/xkbcomp.man b/man/xkbcomp.man
index 9b380a0..0486b7d 100644
--- a/man/xkbcomp.man
+++ b/man/xkbcomp.man
@@ -88,6 +88,9 @@ Specifies the root directory for relative path names.
.B -synch
Force synchronization for X requests.
.TP 8
+.B -version
+Print version number.
+.TP 8
.B \-w\ \fIlvl\fP
Controls the reporting of warnings during compilation. A warning level
of 0 disables all warnings; a warning level of 10 enables them all.
diff --git a/xkbcomp.c b/xkbcomp.c
index 892062f..2a3e8f4 100644
--- a/xkbcomp.c
+++ b/xkbcomp.c
@@ -119,6 +119,7 @@ Usage(int argc, char *argv[])
M1("Usage: %s [options] file[(map)] ...\n", argv[0]);
M("Legal options:\n");
M("-?,-help Print this message\n");
+ M("-version Print the version number\n");
if (!xkblist)
{
M("-a Show all actions\n");
@@ -252,7 +253,11 @@ parseArgs(int argc, char *argv[])
Usage(argc, argv);
exit(0);
}
- else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
+ else if (strcmp(argv[i], "-version") == 0)
+ {
+ printf("xkbcomp %s\n", PACKAGE_VERSION);
+ exit(0);
+ } else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
{
showImplicit = True;
}