From 5bc7d084ca129637e4782de5fc0c13be76ad27b8 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 2 Jan 2022 17:09:29 -0600 Subject: add README.md and logging --- src/options.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/options.c') diff --git a/src/options.c b/src/options.c index b3836a7..c4eb8d4 100644 --- a/src/options.c +++ b/src/options.c @@ -2,21 +2,27 @@ #include #include "options.h" +#include "logging.h" static void print_usage(const char *progname) { - printf("Usage: %s [-c config_file] [-o output_directory]\n", + printf("Usage: %s [-c config_file] [-i input_directory] [-o output_directory]\n", progname); } int parse_options(struct argent_options *opts, int argc, char **argv) { + opts->log_level = 0; opts->conf_filename = "argent.lua"; - opts->output_dir = "build"; + opts->output_dir = "public"; int opt; - while ((opt = getopt(argc, argv, "c:o:")) != -1) { + while ((opt = getopt(argc, argv, "vc:o:")) != -1) { switch (opt) { + case 'v': + opts->log_level += 1; + break; + case 'c': opts->conf_filename = optarg; break; @@ -31,5 +37,8 @@ int parse_options(struct argent_options *opts, int argc, char **argv) } } + // ew, globals (sorry) + argent_log_level = opts->log_level; + return 0; } -- cgit v1.2.1