diff options
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; } |