diff options
author | sanine <sanine.not@pm.me> | 2022-01-02 17:09:29 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-02 17:09:29 -0600 |
commit | 5bc7d084ca129637e4782de5fc0c13be76ad27b8 (patch) | |
tree | 357e032b9f343365b0e8b990eef335c78c67fbe9 /src/options.c | |
parent | 3c95c890245cbd79c9f31c316e7334a8f9229f04 (diff) |
add README.md and logging
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 15 |
1 files changed, 12 insertions, 3 deletions
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 <unistd.h> #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; } |