diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-18 10:48:06 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-18 10:48:06 +0100 |
commit | 254310929ecb9c8e5a63f68b8c293c742583f62b (patch) | |
tree | fd0adcd521b3af3d461e909dee535eee00a87e9c | |
parent | bf7be7d8106b3c72005ae91ffd3318fc33b6591a (diff) |
Allow long options in the build script
-rw-r--r-- | make.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,4 +1,5 @@ #include <errno.h> +#include <getopt.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -37,11 +38,16 @@ main(int argc, char **argv) { int opt; cmd_t c = {0}; + struct option longopts[] = { + {"debug", no_argument, 0, 'd'}, + {"no-pcre", no_argument, 0, 'P'}, + {nullptr, 0, 0, 0 }, + }; cbsinit(argc, argv); rebuild(); - while ((opt = getopt(argc, argv, "dP")) != -1) { + while ((opt = getopt_long(argc, argv, "dP", longopts, nullptr)) != -1) { switch (opt) { case 'd': dflag = true; |