]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Some more changes: added redirout/redirerr command line options
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 1d151c5782152049fc2e1664977c4334bc64e93c..8e94800ec44bbd6460571481ee9243df0ff5f04c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -181,7 +181,10 @@ static void options_set(uint32_t *flags, size_t idx, bool on)
 static bool options_parse(int argc, char **argv) {
     bool argend = false;
     size_t itr;
-    char buffer[1024];
+    char  buffer[1024];
+    char *redirout = (char*)stdout;
+    char *redirerr = (char*)stderr;
+    
     while (!argend && argc > 1) {
         char *argarg;
         argitem item;
@@ -215,6 +218,13 @@ static bool options_parse(int argc, char **argv) {
                 opts_forced_crc = strtol(argarg, NULL, 0);
                 continue;
             }
+            if (options_long_gcc("redirout", &argc, &argv, &redirout)) {
+                continue;
+            }
+            if (options_long_gcc("redirerr", &argc, &argv, &redirerr)) {
+                continue;
+            }
+            
             if (!strcmp(argv[0]+1, "debug")) {
                 opts_debug = true;
                 continue;
@@ -371,6 +381,7 @@ static bool options_parse(int argc, char **argv) {
             items_add(item);
         }
     }
+    con_change(redirout, redirerr);
     return true;
 }
 
@@ -529,7 +540,7 @@ srcdone:
 
 cleanup:
     util_debug("COM", "cleaning ...\n");
-
+    con_close();
     mem_d(items_data);
 
     parser_cleanup();