#include #include #include "options.h" static void print_usage(const char *progname) { printf("Usage: %s [-c config_file] [-o output_directory]\n", progname); } int parse_options(struct argent_options *opts, int argc, char **argv) { opts->conf_filename = "argent.lua"; opts->output_dir = "build"; int opt; while ((opt = getopt(argc, argv, "c:o:")) != -1) { switch (opt) { case 'c': opts->conf_filename = optarg; break; case 'o': opts->output_dir = optarg; break; default: print_usage(argv[0]); return 1; } } return 0; }