initial commit

Signed-off-by: Chloe M. <chloe@mirocom.org>
This commit is contained in:
2026-04-30 08:08:34 -04:00
commit d7b25b944b
5 changed files with 91 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause
*/
#include <stdio.h>
#include <unistd.h>
#include "blobchain/common.h"
static void
help(void)
{
printf("usage: ./blobchain <flags>\n");
printf("... [-h] Display this help menu\n");
printf("... [-v] Display the version\n");
}
static void
version(void)
{
printf("Version v%s\n", BLOBCHAIN_VERSION);
}
int
main(int argc, char **argv)
{
int opt;
if (argc < 2) {
printf("fatal: too few arguments!\n");
help();
return -1;
}
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch (opt) {
case 'h':
help();
return -1;
case 'v':
version();
return -1;
}
}
return 0;
}