1
0

make use of C-Argh library (#5)

This commit is contained in:
Intel A80486DX2-66 2023-11-21 19:06:12 +03:00
parent 27a3ac1fe3
commit 3517473605
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -7,6 +7,9 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
// libraries
#include "../lib/c-argh/argh.h"
// constants // constants
#if defined(_WIN32) #if defined(_WIN32)
# define __ANSI_CLEAR_STRING "\r" # define __ANSI_CLEAR_STRING "\r"
@ -85,14 +88,17 @@ bytebeat(long double w)
; ;
} }
#define USAGE "render_bytebeat [-s | --silent] [-d | --debug]"
int int
main(int argc, char** argv) main(int argc, char** argv)
{ {
// * parse CLI arguments // * parse CLI arguments
silent_mode = argc > 1 && argv[1] != NULL && ARGH_PARSE {
(!strcmp(argv[1], "-s") || !strcmp(argv[1], "--silent")); ARGH_NEXT();
debug_mode = argc > 1 && argv[1] != NULL && if ARGH_BOOL("-s", "--silent") { silent_mode = true; }
(!strcmp(argv[1], "-d") || !strcmp(argv[1], "--debug")); else if ARGH_BOOL("-d", "--debug") { debug_mode = true; }
}
// * log -> welcome // * log -> welcome
printf(":: C bytebeat generator runtime unit\n"); printf(":: C bytebeat generator runtime unit\n");