fix: start migration to comply with GNU style

This commit is contained in:
2025-07-17 21:13:43 -04:00
parent d943d6db8c
commit 414fbf7214
3 changed files with 12 additions and 24 deletions

View File

@@ -20,10 +20,10 @@ build:
mkdir -p c-out/obj mkdir -p c-out/obj
c-out/obj/%.o: yait/%.c c-out/obj/%.o: yait/%.c
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -DCOMMIT=$(shell git rev-list --count --all) -c $< -o $@
$(YAIT): $(YAIT_OBJS) $(YAIT): $(YAIT_OBJS)
$(CC) $(CFLAGS) $^ -o $@ $(CC) $(CFLAGS) -DCOMMIT=$(shell git rev-list --count --all) $^ -o $@
endif endif

View File

@@ -3,7 +3,6 @@
#define PROGRAM "yait" #define PROGRAM "yait"
#define ORGANIZATION "vx_clutch"
#define VERSION "pre-alpha" #define VERSION "pre-alpha"
#define YEAR 2025 #define YEAR 2025

View File

@@ -1,29 +1,18 @@
#include "standard.h" #include "standard.h"
#include "../config.h" #include "../config.h"
#include "print.h" #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
int int parse_standard_options(void (*usage)(), int argc, char **argv) {
parse_standard_options (void (*usage) (), int argc, char **argv) for (int i = 1; i < argc; ++i) {
{ if (strcmp(argv[i], "--help") == 0) {
for (int i = 1; i < argc; ++i) usage();
{ exit(0);
if (strcmp (argv[i], "--help") == 0) } else if (strcmp(argv[i], "--version") == 0) {
{ printf("%s %s %d\n", PROGRAM, VERSION, COMMIT);
usage (); exit(0);
exit (0);
}
else if (strcmp (argv[i], "--version") == 0)
{
printfn ("%s (%s) %s\nCopyright (C) %d %s.\n%s\n"
"This is free software: you are free to change "
"and redistribute it.\nThere is NO WARRANTY, to the extent "
"permitted by law.",
PROGRAM, ORGANIZATION, VERSION, YEAR, ORGANIZATION,
LICENCE_LINE);
exit (0);
}
} }
}
return -1; return -1;
} }