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
Date Sun, 06 Dec 1998 18:54:22 GMT

A few months ago we had a discussion about the -h command line option and the
fact that people are confused because in contrast to other tools our -h option
doesn't give the usage page. Instead it displays this large list of
directives. At this time I've immediately cleaned up the stuff, but totally
forgot this patch in my development queue ;-). I guess we were right before a
release or whatever. So I've now updated the patch for the current state and
here it is.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: src/CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.1165
diff -u -r1.1165 CHANGES
--- src/CHANGES	1998/12/06 16:14:16	1.1165
+++ src/CHANGES	1998/12/06 18:50:01
@@ -1,5 +1,21 @@
 Changes with Apache 1.3.4
 
+  *) 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 for ages by our huge unreadable list of 164
+     directives.  So we now changed the command line options this way:
+     1. `-L' => `-R' 
+        Intent: we need `-L' and `-R' for the DSO run-time path is 
+        similar to the popular linker option
+     2. `-h' => `-L'
+        Intent: while -l gives the small list of modules, -L now
+        gives the large list of directives implemented by these modules
+     3. `-?' => `-h' 
+        Intent: it's now the expected option ;-)
+     The manual page was adjusted accordingly. 
+     [Ralf S. Engelschall] PR#2714
+
   *) PORT: Add Dynamic Shared Object (DSO) support for BSDI (v4.0).
      [Tom Serkowski <tks@bsdi.com>] PR#3453
 
Index: src/main/http_main.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_main.c,v
retrieving revision 1.408
diff -u -r1.408 http_main.c
--- src/main/http_main.c	1998/12/04 19:12:16	1.408
+++ src/main/http_main.c	1998/12/06 18:47:18
@@ -978,15 +978,15 @@
 	pad[i] = ' ';
     pad[i] = '\0';
 #ifdef SHARED_CORE
-    fprintf(stderr, "Usage: %s [-L directory] [-d directory] [-f file]\n", bin);
+    fprintf(stderr, "Usage: %s [-R directory] [-d directory] [-f file]\n", bin);
 #else
     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] [-l] [-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");
+    fprintf(stderr, "  -R directory     : specify an alternate location for shared object
files\n");
 #endif
     fprintf(stderr, "  -D name          : define a name for use in <IfDefine name>
directives\n");
     fprintf(stderr, "  -d directory     : specify an alternate initial ServerRoot\n");
@@ -995,8 +995,9 @@
     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, "  -l               : list compiled-in modules\n");
+    fprintf(stderr, "  -L               : list available configuration directives\n");
     fprintf(stderr, "  -S               : show parsed settings (currently only vhost settings)\n");
     fprintf(stderr, "  -t               : run syntax test for configuration files only\n");
 #ifdef WIN32
@@ -4496,11 +4497,11 @@
 
 #ifndef TPF
     while ((c = getopt(argc, argv,
-				    "D:C:c:Xd:f:vVhlL:St"
+				    "D:C:c:Xd:f:vVlLR:Sth"
 #ifdef DEBUG_SIGSTOP
 				    "Z:"
 #endif
-			)) != -1) {
+			)) != -3) {
 	char **new;
 	switch (c) {
 	case 'c':
@@ -4530,12 +4531,12 @@
 	    ap_set_version();
 	    show_compile_settings();
 	    exit(0);
-	case 'h':
-	    ap_show_directives();
-	    exit(0);
 	case 'l':
 	    ap_show_modules();
 	    exit(0);
+	case 'L':
+	    ap_show_directives();
+	    exit(0);
 	case 'X':
 	    ++one_process;	/* Weird debugging mode. */
 	    break;
@@ -4545,7 +4546,7 @@
 	    break;
 #endif
 #ifdef SHARED_CORE
-	case 'L':
+	case 'R':
 	    /* just ignore this option here, because it has only
 	     * effect when SHARED_CORE is used and then it was
 	     * already handled in the Shared Core Bootstrap
@@ -4559,6 +4560,8 @@
 	case 't':
 	    configtestonly = 1;
 	    break;
+	case 'h':
+	    usage(argv[0]);
 	case '?':
 	    usage(argv[0]);
 	}
@@ -5853,7 +5856,7 @@
 
     ap_setup_prelinked_modules();
 
-    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlZ:iusStk:")) != -1) {
+    while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVHlZ:iusSthk:")) != -1) {
         char **new;
 	switch (c) {
 	case 'c':
@@ -5911,7 +5914,7 @@
 	    ap_set_version();
 	    show_compile_settings();
 	    exit(0);
-	case 'h':
+	case 'H':
 	    ap_show_directives();
 	    exit(0);
 	case 'l':
@@ -5923,6 +5926,8 @@
 	case 't':
 	    configtestonly = 1;
 	    break;
+	case 'h':
+	    usage(argv[0]);
 	case '?':
 	    usage(argv[0]);
 	}
@@ -6060,7 +6065,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:vVlLR:SZ:th")) != -1) {
 	switch (c) {
 	case 'D':
 	case 'C':
@@ -6070,14 +6075,15 @@
 	case 'f':
 	case 'v':
 	case 'V':
-	case 'h':
 	case 'l':
+	case 'L':
 	case 'S':
 	case 'Z':
 	case 't':
+	case 'h':
 	case '?':
 	    break;
-	case 'L':
+	case 'R':
 	    llp_dir = strdup(optarg);
 	    break;
 	}
Index: src/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
--- src/support/httpd.8	1998/06/16 03:37:32	1.11
+++ src/support/httpd.8	1998/12/06 18:42:19
@@ -60,7 +60,7 @@
 [
 .B \-X
 ] [
-.BI \-L " libexecdir"
+.BI \-R " libexecdir"
 ] [
 .BI \-d " serverroot"
 ] [
@@ -81,6 +81,9 @@
 .B \-l
 ] 
 [
+.B \-L
+] 
+[
 .B \-v
 ] 
 [
@@ -89,9 +92,6 @@
 [
 .B \-S
 ] 
-[
-.B \-?
-] 
 
 .SH DESCRIPTION
 .B httpd
@@ -115,7 +115,7 @@
 .B httpd.
 .SH OPTIONS
 .TP 12
-.BI \-L " libexecdir"
+.BI \-R " libexecdir"
 This option is only available if Apache was built with
 the 
 .I SHARED_CORE
@@ -146,12 +146,15 @@
 to conditionally skip or process commands.
 .TP
 .B \-h
-Output a list of directives together with expected arguments and
-places where the directive is valid.
+Output a short summary of available command line options.
 .TP
 .B \-l
 Output a list of modules compiled into the server.
 .TP
+.B \-L
+Output a list of directives together with expected arguments and
+places where the directive is valid.
+.TP
 .B \-S
 Show the settings as parsed from the config file (currently only shows the
 virtualhost settings).
@@ -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