core: Add initial command line options

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-02-09 16:20:04 -05:00
parent 1428ab4d28
commit 5fcbdc9525

View File

@@ -1,7 +1,47 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#define CAV_VERSION "0.0.1"
static void
help(void)
{
printf(
"Consume and vomit - blugh!\n"
"--------------------------\n"
"[-h] Display this help menu\n"
"[-v] Display the version\n"
);
}
static void
version(void)
{
printf(
"Consume and vomit - blugh!\n"
"--------------------------\n"
"Copyright (c) 2026, Ian Moffett\n"
"Version %s\n",
CAV_VERSION
);
}
int
main(void)
main(int argc, char **argv)
{
int opt;
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch (opt) {
case 'h':
help();
return -1;
case 'v':
version();
return -1;
}
}
return 0;
}