aboutsummaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-18 10:48:06 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-18 10:48:06 +0100
commit254310929ecb9c8e5a63f68b8c293c742583f62b (patch)
treefd0adcd521b3af3d461e909dee535eee00a87e9c /make.c
parentbf7be7d8106b3c72005ae91ffd3318fc33b6591a (diff)
Allow long options in the build script
Diffstat (limited to 'make.c')
-rw-r--r--make.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/make.c b/make.c
index e63eeb7..48596a4 100644
--- a/make.c
+++ b/make.c
@@ -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;