]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Better usage message for qcvm, don't exit after any of the information prints - but...
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 6ae009145479850cca3c0f3dc5aaaf3db6eab007..fca93b2d87b27932258607e2848fbcac491916b2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -61,6 +61,7 @@ static int usage() {
     con_out("  -o, --output=file      output file, defaults to progs.dat\n"
             "  -s filename            add a progs.src file to be used\n");
     con_out("  -E                     stop after preprocessing\n");
+    con_out("  -config file           use the specified ini file\n");
     con_out("  -std=standard          select one of the following standards\n"
             "       -std=qcc          original QuakeC\n"
             "       -std=fteqcc       fteqcc QuakeC\n"
@@ -138,6 +139,7 @@ static bool options_parse(int argc, char **argv) {
     char  buffer[1024];
     char *redirout = (char*)stdout;
     char *redirerr = (char*)stderr;
+    char *config   = NULL;
 
     while (!argend && argc > 1) {
         char *argarg;
@@ -195,6 +197,10 @@ static bool options_parse(int argc, char **argv) {
                 con_change(redirout, redirerr);
                 continue;
             }
+            if (options_long_gcc("config", &argc, &argv, &argarg)) {
+                config = argarg;
+                continue;
+            }
 
             /* show defaults (like pathscale) */
             if (!strcmp(argv[0]+1, "show-defaults")) {
@@ -437,6 +443,7 @@ static bool options_parse(int argc, char **argv) {
             vec_push(items, item);
         }
     }
+    opts_ini_init(config);
     return true;
 }