summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo.c14
-rw-r--r--help.txt5
2 files changed, 16 insertions, 3 deletions
diff --git a/demo.c b/demo.c
index 743eaf4..51f5f75 100644
--- a/demo.c
+++ b/demo.c
@@ -34,6 +34,7 @@
#include <X11/Xatom.h>
#include <X11/extensions/Xrandr.h>
+#define VERSION_STRING "alpha-v3"
#define LUT_SIZE 4096
@@ -553,6 +554,11 @@ static void print_short_help()
free(short_help);
}
+static void print_version()
+{
+ printf("%s\n", VERSION_STRING);
+}
+
int main(int argc, char *const argv[])
@@ -587,8 +593,12 @@ int main(int argc, char *const argv[])
int ctm_changed;
int regamma_changed, regamma_is_srgb;
- while ((opt = getopt(argc, argv, "ho:d:c:r:")) != -1) {
- if (opt == 'd')
+ while ((opt = getopt(argc, argv, "vho:d:c:r:")) != -1) {
+ if (opt == 'v') {
+ print_version();
+ return 0;
+ }
+ else if (opt == 'd')
degamma_opt = optarg;
else if (opt == 'c')
ctm_opt = optarg;
diff --git a/help.txt b/help.txt
index 62583a7..1ca212b 100644
--- a/help.txt
+++ b/help.txt
@@ -1,4 +1,4 @@
-Usage: cmdemo -o OUTPUT_NAME [-d DEGAMMA_OPTS] [-c CTM_OPTS] [-r REGAMMA_OPTS] [-h]
+Usage: cmdemo -o OUTPUT_NAME [-d DEGAMMA_OPTS] [-c CTM_OPTS] [-r REGAMMA_OPTS] [-h] [-v]
Demo app for setting non-legacy color management via libXrandr. Note that this
requires color management support from the amdgpu DDX driver.
@@ -58,5 +58,8 @@ Optional arguments:
where y=f(x) represents the regamma curve, and x and y are
color vectors containing real values within range [0, 1]
+ -v
+ Print version.
+
-h
Show this message.