From cc82d13a4f80a5a2483581dd679f06772a9e3a19 Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 4 Jan 2022 15:05:41 -0600 Subject: add layout loading --- src/options.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/options.c') diff --git a/src/options.c b/src/options.c index d221828..e694f99 100644 --- a/src/options.c +++ b/src/options.c @@ -6,18 +6,26 @@ static void print_usage(const char *progname) { - printf("Usage: %s [-c config_file] [-i input_directory] [-o output_directory]\n", + printf("Usage: %s [-c config_file] [-v[v[v]]] [-q[q[q]]] [-h]\n" + " -v Increase output verbosity\n" + " -q Decrease output verbosity\n" + " -c Specifiy configuration file to read (default 'config.lua')\n" + " -h Print this help message and exit\n", progname); } int parse_options(struct argent_options *opts, int argc, char **argv) { - opts->log_level = 0; + opts->log_level = WARN; opts->conf_filename = "config.lua"; int opt; - while ((opt = getopt(argc, argv, "vc:")) != -1) { + while ((opt = getopt(argc, argv, "hqvc:")) != -1) { switch (opt) { + case 'q': + opts->log_level -= 1; + break; + case 'v': opts->log_level += 1; break; @@ -26,6 +34,10 @@ int parse_options(struct argent_options *opts, int argc, char **argv) opts->conf_filename = optarg; break; + case 'h': + print_usage(argv[0]); + return 2; + default: print_usage(argv[0]); return 1; -- cgit v1.2.1