make use of C-Argh library (#5)
This commit is contained in:
parent
27a3ac1fe3
commit
3517473605
@ -7,6 +7,9 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
// libraries
|
||||
#include "../lib/c-argh/argh.h"
|
||||
|
||||
// constants
|
||||
#if defined(_WIN32)
|
||||
# define __ANSI_CLEAR_STRING "\r"
|
||||
@ -85,14 +88,17 @@ bytebeat(long double w)
|
||||
;
|
||||
}
|
||||
|
||||
#define USAGE "render_bytebeat [-s | --silent] [-d | --debug]"
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
// * parse CLI arguments
|
||||
silent_mode = argc > 1 && argv[1] != NULL &&
|
||||
(!strcmp(argv[1], "-s") || !strcmp(argv[1], "--silent"));
|
||||
debug_mode = argc > 1 && argv[1] != NULL &&
|
||||
(!strcmp(argv[1], "-d") || !strcmp(argv[1], "--debug"));
|
||||
ARGH_PARSE {
|
||||
ARGH_NEXT();
|
||||
if ARGH_BOOL("-s", "--silent") { silent_mode = true; }
|
||||
else if ARGH_BOOL("-d", "--debug") { debug_mode = true; }
|
||||
}
|
||||
|
||||
// * log -> welcome
|
||||
printf(":: C bytebeat generator runtime unit\n");
|
||||
|
Loading…
Reference in New Issue
Block a user