summaryrefslogtreecommitdiff
path: root/x11perf.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-18 12:23:45 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-18 12:24:58 -0700
commitcb073d318328d8ac2df64aed195d933cf64b5358 (patch)
treeeab018c45fca2e7f921a597e3677b4719442084f /x11perf.c
parent16fda0825a0c6a51f800c225e66adce65e5f327c (diff)
Add -version option
(Also accepts but does not document --version) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/test/x11perf/-/merge_requests/10>
Diffstat (limited to 'x11perf.c')
-rw-r--r--x11perf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/x11perf.c b/x11perf.c
index 8018bf7..cea0351 100644
--- a/x11perf.c
+++ b/x11perf.c
@@ -358,7 +358,7 @@ Get_Display_Name(int *pargc, /* MODIFIED */
/*
* GetVersion (argc, argv) Look for -v followed by a version number.
* If found remove it from command line. Don't go past a lone -.
- * Leave -v followed by non-numbers as it could be -vclass.
+ * Leave -v followed by non-numbers as it could be -vclass or -version.
*/
static Version
@@ -500,6 +500,7 @@ usage(void)
" -v1.5 perform only v1.5 tests using old semantics\n"
" -v1.6 perform only v1.6 tests using old semantics\n"
" -v1.7 perform only v1.7 tests using old semantics\n"
+" -version print version and exit\n"
" -su request save unders on windows\n"
" -bs <backing_store_hint> WhenMapped or Always (default = NotUseful)\n"
;
@@ -1069,6 +1070,10 @@ main(int argc, char *argv[])
} else if (strcmp(argv[i], "Always") == 0) {
xparms.backing_store = Always;
} else usage ();
+ } else if ((strcmp(argv[i], "-version") == 0) ||
+ (strcmp(argv[i], "--version") == 0)) {
+ puts(PACKAGE_STRING);
+ exit(EXIT_SUCCESS);
} else {
int len,found;
ForEachTest (j) {