Received: by taz.hyperreal.com (8.7.5/V2.0) id LAA13406; Mon, 19 Aug 1996 11:44:20 -0700 (PDT) Received: by taz.hyperreal.com (8.7.5/V2.0) id LAA13391; Mon, 19 Aug 1996 11:44:18 -0700 (PDT) Date: Mon, 19 Aug 1996 11:44:18 -0700 (PDT) From: Ben Laurie Message-Id: <199608191844.LAA13391@taz.hyperreal.com> To: apache-cvs@hyperreal.com Subject: cvs commit: apache/src http_main.c Sender: owner-apache-cvs@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com ben 96/08/19 11:44:17 Modified: src http_main.c Log: Add directive listing option. Revision Changes Path 1.61 +22 -2 apache/src/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C3 -r1.60 -r1.61 *** http_main.c 1996/08/19 18:32:58 1.60 --- http_main.c 1996/08/19 18:44:16 1.61 *************** *** 340,348 **** void usage(char *bin) { ! fprintf(stderr,"Usage: %s [-d directory] [-f file] [-v]\n",bin); fprintf(stderr,"-d directory : specify an alternate initial ServerRoot\n"); fprintf(stderr,"-f file : specify an alternate ServerConfigFile\n"); exit(1); } --- 340,350 ---- void usage(char *bin) { ! fprintf(stderr,"Usage: %s [-d directory] [-f file] [-v] [-h]\n",bin); fprintf(stderr,"-d directory : specify an alternate initial ServerRoot\n"); fprintf(stderr,"-f file : specify an alternate ServerConfigFile\n"); + fprintf(stderr,"-v : show version number\n"); + fprintf(stderr,"-h : list directives\n"); exit(1); } *************** *** 1811,1816 **** --- 1813,1833 ---- } /* standalone_main */ + void show_directives() + { + extern module *prelinked_modules[]; + extern char *module_names[]; + command_rec *pc; + int n; + int t; + + for(t=0 ; prelinked_modules[t] ; ++t) + ; + for(n=0 ; prelinked_modules[n] ; ++n) + for(pc=prelinked_modules[n]->cmds ; pc && pc->name ; ++pc) + printf("%s\t%s\t%s\n",pc->name,pc->errmsg,module_names[t-n-1]); + } + extern char *optarg; extern int optind; *************** *** 1841,1847 **** strcpy (server_root, HTTPD_ROOT); strcpy (server_confname, SERVER_CONFIG_FILE); ! while((c = getopt(argc,argv,"Xd:f:v")) != -1) { switch(c) { case 'd': strcpy (server_root, optarg); --- 1858,1864 ---- strcpy (server_root, HTTPD_ROOT); strcpy (server_confname, SERVER_CONFIG_FILE); ! while((c = getopt(argc,argv,"Xd:f:vh")) != -1) { switch(c) { case 'd': strcpy (server_root, optarg); *************** *** 1852,1857 **** --- 1869,1877 ---- case 'v': printf("Server version %s.\n",SERVER_VERSION); exit(1); + case 'h': + show_directives(); + exit(1); case 'X': ++one_process; /* Weird debugging mode. */ break;