]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/help.c
q3map2/help: add -help all
[xonotic/netradiant.git] / tools / quake3 / q3map2 / help.c
index f6974a6c30a6d25e3af590ae907290538d806885..56916b63741d5ef64853d54e8e43927882d994ca 100644 (file)
@@ -462,7 +462,8 @@ void HelpGames()
 void HelpMain(const char* arg)
 {
        printf("Usage: q3map2 [stage] [common options...] [stage options...] [stage source file]\n");
-       printf("       q3map2 -help [stage]\n\n");
+       printf("       q3map2 -help [stage]\n");
+       printf("       q3map2 -help all\n\n");
 
        static char termbuf[2048];
        char *termtype = getenv("TERM");
@@ -507,15 +508,29 @@ void HelpMain(const char* arg)
        if ( arg && strlen(arg) > 0 )
        {
                if ( arg[0] == '-' )
+               {
                        arg++;
+               }
+
+               if ( strcmp(arg, "all") == 0 )
+               {
+                       HelpOptions("Stages", 0, terminalColumns, stages, sizeof(stages)/sizeof(struct HelpOption));
 
-               unsigned i;
-               for ( i = 0; i < sizeof(stages)/sizeof(struct HelpOption); i++ )
+                       for ( unsigned i = 0; i < sizeof(stages)/sizeof(struct HelpOption); i++ )
+                       {
+                               help_funcs[i]();
+                       }
+                       return;
+               }
+
+               for ( unsigned i = 0; i < sizeof(stages)/sizeof(struct HelpOption); i++ )
+               {
                        if ( strcmp(arg, stages[i].name+1) == 0 )
                        {
                                help_funcs[i]();
                                return;
                        }
+               }
        }
 
        HelpOptions("Stages", 0, terminalColumns, stages, sizeof(stages)/sizeof(struct HelpOption));