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;