Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd alpha sort the option switch.
details: https://anonhg.NetBSD.org/src/rev/dff339b121d2
branches: trunk
changeset: 446078:dff339b121d2
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Nov 22 18:21:59 2018 +0000
description:
alpha sort the option switch.
diffstat:
libexec/httpd/main.c | 288 +++++++++++++++++++++++++-------------------------
1 files changed, 145 insertions(+), 143 deletions(-)
diffs (truncated from 334 to 300 lines):
diff -r d48328339d6e -r dff339b121d2 libexec/httpd/main.c
--- a/libexec/httpd/main.c Thu Nov 22 15:09:45 2018 +0000
+++ b/libexec/httpd/main.c Thu Nov 22 18:21:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.19 2018/11/22 08:54:08 mrg Exp $ */
+/* $NetBSD: main.c,v 1.20 2018/11/22 18:21:59 mrg Exp $ */
/* $eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $ */
/* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp */
@@ -163,79 +163,6 @@
"C:EGHI:L:M:P:S:T:U:VXZ:bc:defhi:np:st:uv:x:z:")) != -1) {
switch (c) {
- case 'L':
- if (!have_lua)
- bozoerr(&httpd, 1, "Lua support not enabled");
-
- /* make sure there's two argument */
- if (argc - optind < 1)
- usage(&httpd, progname);
- bozo_add_lua_map(&httpd, optarg, argv[optind]);
- optind++;
- break;
- case 'M':
- if (!have_dynamic_content)
- bozoerr(&httpd, 1,
- "dynamic mime content support not enabled");
-
- /* make sure there're four arguments */
- if (argc - optind < 3)
- usage(&httpd, progname);
- bozo_add_content_map_mime(&httpd, optarg, argv[optind],
- argv[optind+1], argv[optind+2]);
- optind += 3;
- break;
-
- case 'n':
- bozo_set_pref(&httpd, &prefs, "numeric", "true");
- break;
-
- case 's':
- bozo_set_pref(&httpd, &prefs, "log to stderr", "true");
- break;
-
- case 'S':
- bozo_set_pref(&httpd, &prefs, "server software",
- optarg);
- break;
- case 'Z':
- if (!have_ssl)
- no_ssl:
- bozoerr(&httpd, 1, "ssl support not enabled");
-
- /* make sure there's two arguments */
- if (argc - optind < 1)
- usage(&httpd, progname);
- bozo_ssl_set_opts(&httpd, optarg, argv[optind++]);
- break;
-
- case 'z':
- if (!have_ssl)
- goto no_ssl;
-
- bozo_ssl_set_ciphers(&httpd, optarg);
- break;
-
- case 'U':
- bozo_set_pref(&httpd, &prefs, "username", optarg);
- break;
-
- case 'V':
- bozo_set_pref(&httpd, &prefs, "unknown slash", "true");
- break;
-
- case 'v':
- bozo_set_pref(&httpd, &prefs, "virtual base", optarg);
- break;
-
- case 'x':
- bozo_set_pref(&httpd, &prefs, "index.html", optarg);
- break;
-
- case 'I':
- bozo_set_pref(&httpd, &prefs, "port number", optarg);
- break;
-
case 'b':
if (!have_daemon_mode)
no_daemon_mode:
@@ -251,35 +178,6 @@
bozo_set_pref(&httpd, &prefs, "background", val);
break;
- case 'e':
- if (!have_daemon_mode)
- goto no_daemon_mode;
-
- bozo_set_pref(&httpd, &prefs, "dirty environment",
- "true");
- break;
-
- case 'f':
- if (!have_daemon_mode)
- goto no_daemon_mode;
-
- bozo_set_pref(&httpd, &prefs, "foreground", "true");
- break;
-
- case 'i':
- if (!have_daemon_mode)
- goto no_daemon_mode;
-
- bozo_set_pref(&httpd, &prefs, "bind address", optarg);
- break;
-
- case 'P':
- if (!have_daemon_mode)
- goto no_daemon_mode;
-
- bozo_set_pref(&httpd, &prefs, "pid file", optarg);
- break;
-
case 'c':
if (!have_cgibin)
bozoerr(&httpd, 1, "CGI not enabled");
@@ -305,8 +203,89 @@
httpd.debug++;
break;
- case 't':
- bozo_set_pref(&httpd, &prefs, "chroot dir", optarg);
+ case 'E':
+ if (have_user &&
+ have_cgibin)
+ bozoerr(&httpd, 1, "CGI not enabled");
+
+ bozo_set_pref(&httpd, &prefs, "enable user cgibin",
+ "true");
+ break;
+
+ case 'e':
+ if (!have_daemon_mode)
+ goto no_daemon_mode;
+
+ bozo_set_pref(&httpd, &prefs, "dirty environment",
+ "true");
+ break;
+
+ case 'f':
+ if (!have_daemon_mode)
+ goto no_daemon_mode;
+
+ bozo_set_pref(&httpd, &prefs, "foreground", "true");
+ break;
+
+ case 'G':
+ {
+ char version[128];
+
+ bozo_get_version(version, sizeof(version));
+ printf("bozohttpd version %s\n", version);
+ }
+ return 0;
+
+ case 'H':
+ if (!have_dirindex)
+ no_dirindex_support:
+ bozoerr(&httpd, 1,
+ "directory indexing not enabled");
+
+ bozo_set_pref(&httpd, &prefs, "hide dots", "true");
+ break;
+
+ case 'I':
+ bozo_set_pref(&httpd, &prefs, "port number", optarg);
+ break;
+
+ case 'i':
+ if (!have_daemon_mode)
+ goto no_daemon_mode;
+
+ case 'L':
+ if (!have_lua)
+ bozoerr(&httpd, 1, "Lua support not enabled");
+
+ /* make sure there's two argument */
+ if (argc - optind < 1)
+ usage(&httpd, progname);
+ bozo_add_lua_map(&httpd, optarg, argv[optind]);
+ optind++;
+ break;
+
+ case 'M':
+ if (!have_dynamic_content)
+ bozoerr(&httpd, 1,
+ "dynamic mime content support not enabled");
+
+ /* make sure there're four arguments */
+ if (argc - optind < 3)
+ usage(&httpd, progname);
+ bozo_add_content_map_mime(&httpd, optarg, argv[optind],
+ argv[optind+1], argv[optind+2]);
+ optind += 3;
+ break;
+
+ case 'n':
+ bozo_set_pref(&httpd, &prefs, "numeric", "true");
+ break;
+
+ case 'P':
+ if (!have_daemon_mode)
+ goto no_daemon_mode;
+
+ bozo_set_pref(&httpd, &prefs, "pid file", optarg);
break;
case 'p':
@@ -317,48 +296,15 @@
bozo_set_pref(&httpd, &prefs, "public_html", optarg);
break;
- case 'u':
- if (!have_user)
- goto no_user_support;
-
- bozo_set_pref(&httpd, &prefs, "enable users", "true");
- break;
-
- case 'E':
- if (have_user &&
- have_cgibin)
- bozoerr(&httpd, 1, "CGI not enabled");
-
- bozo_set_pref(&httpd, &prefs, "enable user cgibin",
- "true");
+ case 'S':
+ bozo_set_pref(&httpd, &prefs, "server software",
+ optarg);
break;
- case 'H':
- if (!have_dirindex)
- no_dirindex_support:
- bozoerr(&httpd, 1,
- "directory indexing not enabled");
-
- bozo_set_pref(&httpd, &prefs, "hide dots", "true");
+ case 's':
+ bozo_set_pref(&httpd, &prefs, "log to stderr", "true");
break;
- case 'X':
- if (!have_dirindex)
- goto no_dirindex_support;
-
- bozo_set_pref(&httpd, &prefs, "directory indexing",
- "true");
- break;
-
- case 'G':
- {
- char version[128];
-
- bozo_get_version(version, sizeof(version));
- printf("bozohttpd version %s\n", version);
- }
- return 0;
-
case 'T':
/* make sure there're two arguments */
if (argc - optind < 1)
@@ -372,6 +318,62 @@
optind++;
break;
+ case 't':
+ bozo_set_pref(&httpd, &prefs, "chroot dir", optarg);
+ break;
+
+ case 'U':
+ bozo_set_pref(&httpd, &prefs, "username", optarg);
+ break;
+
+ case 'u':
+ if (!have_user)
+ goto no_user_support;
+
+ bozo_set_pref(&httpd, &prefs, "enable users", "true");
+ break;
+
+ bozo_set_pref(&httpd, &prefs, "directory indexing",
+ "true");
+ break;
+
+ case 'V':
+ bozo_set_pref(&httpd, &prefs, "unknown slash", "true");
+ break;
+
+ case 'v':
+ bozo_set_pref(&httpd, &prefs, "virtual base", optarg);
Home |
Main Index |
Thread Index |
Old Index