#include #include #include "options.h" #include "logging.h" static void print_usage(const char *progname) { 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 = "config.lua"; int opt; while ((opt = getopt(argc, argv, "vc:")) != -1) { switch (opt) { case 'v': opts->log_level += 1; break; case 'c': opts->conf_filename = optarg; break; default: print_usage(argv[0]); return 1; } } // ew, globals (sorry) argent_log_level = opts->log_level; return 0; }