From 254310929ecb9c8e5a63f68b8c293c742583f62b Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 18 Jan 2024 10:48:06 +0100 Subject: Allow long options in the build script --- make.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/make.c b/make.c index e63eeb7..48596a4 100644 --- a/make.c +++ b/make.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -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; -- cgit v1.2.3