httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject [PATCH] Cleanup command line options (PR#2714)
Date Mon, 27 Jul 1998 15:30:03 GMT

Some time ago when I already cleaned up the command line options for 1.3.0 I
saw the invalid `-?' option but thought its not really important to clean this
up, too. Then I stumpled over -h every time I wanted the usage summary and
instead got the huge directive help page with 164 entries.  And now that I see
other have similar problems its really time to clean this up to let `httpd'
respond more as the user expects. 

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Index: CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.989
diff -u -r1.989 CHANGES
--- CHANGES	1998/07/27 14:58:17	1.989
+++ CHANGES	1998/07/27 15:26:52
@@ -1,4 +1,13 @@
 Changes with Apache 1.3.2
+  
+  *) Cleanup the command line options: `-?' was documented to show
+     the usage list but does it with an error because `?' is not a valid
+     command. OTOH a lot of users expect `-h' to print such a usage list and
+     instead are annoyed by a huge anreadable list of 164 directives.  We now
+     changed `-h' to `-H' (intent is: its large help so use a capital `H',
+     `-?' to `-h' (intent is: its short help so use the expected lowercase
+     `h'). The manual page was adjusted accordingly.
+     [Ralf S. Engelschall] PR#2714
 
   *) Fix Win32 part of ap_spawn_child() by providing a reasonable child_info
      structure instead of just NULL. This fixes at least the RewriteMap
Index: main/http_main.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_main.c,v
retrieving revision 1.375
diff -u -r1.375 http_main.c
--- http_main.c	1998/07/20 16:37:11	1.375
+++ http_main.c	1998/07/27 15:21:36
@@ -942,7 +942,7 @@
     fprintf(stderr, "Usage: %s [-d directory] [-f file]\n", bin);
 #endif
     fprintf(stderr, "       %s [-C \"directive\"] [-c \"directive\"]\n", pad);
-    fprintf(stderr, "       %s [-v] [-V] [-h] [-l] [-S] [-t]\n", pad);
+    fprintf(stderr, "       %s [-v] [-V] [-h] [-H] [-l] [-S] [-t]\n", pad);
     fprintf(stderr, "Options:\n");
 #ifdef SHARED_CORE
     fprintf(stderr, "  -L directory     : specify an alternate location for shared object
files\n");
@@ -954,7 +954,8 @@
     fprintf(stderr, "  -c \"directive\"   : process directive after  reading config files\n");
     fprintf(stderr, "  -v               : show version number\n");
     fprintf(stderr, "  -V               : show compile settings\n");
-    fprintf(stderr, "  -h               : list available configuration directives\n");
+    fprintf(stderr, "  -h               : list available command line options (this page)\n");
+    fprintf(stderr, "  -H               : list available configuration directives\n");
     fprintf(stderr, "  -l               : list compiled-in modules\n");
     fprintf(stderr, "  -S               : show parsed settings (currently only vhost settings)\n");
     fprintf(stderr, "  -t               : run syntax test for configuration files only\n");
@@ -4314,7 +4315,7 @@
     ap_setup_prelinked_modules();
 
     while ((c = getopt(argc, argv,
-				    "D:C:c:Xd:f:vVhlL:St"
+				    "D:C:c:Xd:f:vVHlL:Sth"
 #ifdef DEBUG_SIGSTOP
 				    "Z:"
 #endif
@@ -4348,7 +4349,7 @@
 	    ap_set_version();
 	    show_compile_settings();
 	    exit(0);
-	case 'h':
+	case 'H':
 	    ap_show_directives();
 	    exit(0);
 	case 'l':
@@ -4377,6 +4378,8 @@
 	case 't':
 	    configtestonly = 1;
 	    break;
+	case 'h':
+	    usage(argv[0]);
 	case '?':
 	    usage(argv[0]);
 	}
@@ -5480,7 +5483,7 @@
 
     ap_setup_prelinked_modules();
 
-    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlZ:iusSt")) != -1) {
+    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVHlZ:iusSth")) != -1) {
         char **new;
 	switch (c) {
 	case 'c':
@@ -5533,7 +5536,7 @@
 	    ap_set_version();
 	    show_compile_settings();
 	    exit(0);
-	case 'h':
+	case 'H':
 	    ap_show_directives();
 	    exit(0);
 	case 'l':
@@ -5545,6 +5548,8 @@
 	case 't':
 	    configtestonly = 1;
 	    break;
+	case 'h':
+	    usage(argv[0]);
 	case '?':
 	    usage(argv[0]);
 	}
@@ -5671,7 +5676,7 @@
      * but only handle the -L option 
      */
     llp_dir = SHARED_CORE_DIR;
-    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlL:SZ:t")) != -1) {
+    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVHlL:SZ:th")) != -1) {
 	switch (c) {
 	case 'D':
 	case 'C':
@@ -5681,11 +5686,12 @@
 	case 'f':
 	case 'v':
 	case 'V':
-	case 'h':
+	case 'H':
 	case 'l':
 	case 'S':
 	case 'Z':
 	case 't':
+	case 'h':
 	case '?':
 	    break;
 	case 'L':
Index: support/httpd.8
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/support/httpd.8,v
retrieving revision 1.11
diff -u -r1.11 httpd.8
--- httpd.8	1998/06/16 03:37:32	1.11
+++ httpd.8	1998/07/27 15:23:10
@@ -78,6 +78,9 @@
 .B \-h
 ] 
 [
+.B \-H
+] 
+[
 .B \-l
 ] 
 [
@@ -89,9 +92,6 @@
 [
 .B \-S
 ] 
-[
-.B \-?
-] 
 
 .SH DESCRIPTION
 .B httpd
@@ -146,6 +146,9 @@
 to conditionally skip or process commands.
 .TP
 .B \-h
+Output a short summary of available command line options.
+.TP
+.B \-H
 Output a list of directives together with expected arguments and
 places where the directive is valid.
 .TP
@@ -175,11 +178,6 @@
 Print the version and build parameters of 
 .B httpd
 , and then exit.
-.TP
-.B \-?
-Print a list of the 
-.B httpd 
-options, and then exit.
 .SH FILES
 .PD 0
 .B /usr/local/apache/conf/httpd.conf

Mime
View raw message