colourpicker

Simple Colour Picker written in C
git clone anongit@rnpnr.xyz:colourpicker.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: d1886feefe18ff9258dc5b172362619e2f45ef86
Parent: 872eaffc6fa20680f2388c5aa8f3357ce15136ef
Author: Randy Palamar
Date:   Fri,  9 Aug 2024 07:16:34 -0600

add version command line flag

Diffstat:
Mbuild.sh | 4+++-
Mmain.c | 4++++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/build.sh b/build.sh @@ -1,7 +1,9 @@ #!/bin/sh +version=0.0 + cflags=${CFLAGS:-"-march=native -O3 -Wall"} -cflags="${cflags} -std=c11 -I./external/include" +cflags="${cflags} -std=c11 -I./external/include -DVERSION=\"$version\"" ldflags=${LDFLAGS:-"-flto"} ldflags="$ldflags -lraylib -lm" diff --git a/main.c b/main.c @@ -120,6 +120,10 @@ main(i32 argc, char *argv[]) v4 rgb = hsv_to_rgb(ctx.colour); for (i32 i = 1; i < argc; i++) { if (argv[i][0] == '-') { + if (argv[i][1] == 'v') { + printf("colour picker %s\n", VERSION); + return 0; + } if (argv[i + 1] == NULL || (argv[i][1] == 'h' && !ISHEX(argv[i + 1][0]))) usage(argv[0]);