]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Implemented -show-defaults
authorDale Weiler <killfieldengine@gmail.com>
Sat, 24 Nov 2012 00:26:25 +0000 (00:26 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 24 Nov 2012 00:26:51 +0000 (00:26 +0000)
main.c

diff --git a/main.c b/main.c
index 73e813d554d0f467c1aeb93223a371a22d85553b..ca489a2198dbbb8bbc0208d8faee8a4acad3e5d5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -229,6 +229,31 @@ static bool options_parse(int argc, char **argv) {
                 con_change(redirout, redirerr);
                 continue;
             }
+            
+            /* show defaults (like pathscale) */
+            if (!strcmp(argv[0]+1, "show-defaults")) {
+                size_t itr;
+                char   buffer[1024];
+                for (itr = 0; itr < COUNT_FLAGS; ++itr) {
+                    if (!OPTS_FLAG(itr))
+                        continue;
+                        
+                    memset(buffer, 0, sizeof(buffer));
+                    util_strtononcmd(opts_flag_list[itr].name, buffer, strlen(opts_flag_list[itr].name) + 1);
+    
+                    con_out("-f%s ", buffer);
+                }
+                for (itr = 0; itr < COUNT_WARNINGS; ++itr) {
+                    if (!OPTS_WARN(itr))
+                        continue;
+                    
+                    memset(buffer, 0, sizeof(buffer));
+                    util_strtononcmd(opts_warn_list[itr].name, buffer, strlen(opts_warn_list[itr].name) + 1);
+                    con_out("-W%s ", buffer);
+                }
+                con_out("\n");
+                exit(0);
+            }
 
             if (!strcmp(argv[0]+1, "debug")) {
                 opts_debug = true;