diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-08 21:03:52 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-08 21:03:52 +0000 |
commit | 9312af211e9a2395a96ddb11d6e2f7cdcd928067 (patch) | |
tree | d9f793f6bebc644bd8893237c235a542014b3220 | |
parent | 92f744e4216e9e48247891fb73c8fb9e42419f4c (diff) |
Fix bug #1008 by moving parse_options() back to init_secondary() (reverts r1426) and moving the options for -debug, -nofork, and -support into parse_dir_options() instead (real reason for r1426).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1950 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/init.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/init.c b/src/init.c index 8a3638138..52bb26558 100644 --- a/src/init.c +++ b/src/init.c @@ -105,6 +105,14 @@ static int parse_dir_options(int ac, char **av) return -1; } log_filename = av[i]; + } else if (strcmp(s, "debug") == 0) { + ++debug; + } else if (strcmp(s, "nofork") == 0) { + nofork = 1; + } else if (strcmp(s, "support") == 0) { + nofork = 1; + ++debug; + nothird = 1; } else if (strcmp(s, "version") == 0) { fprintf(stdout, "Anope-%s %s -- %s\n", version_number, version_flags, version_build); @@ -226,11 +234,11 @@ static int parse_options(int ac, char **av) } else ExpireTimeout = atol(s); } else if (strcmp(s, "debug") == 0) { - debug++; + /* Handled by parse_dir_options() */ } else if (strcmp(s, "readonly") == 0) { readonly = 1; } else if (strcmp(s, "nofork") == 0) { - nofork = 1; + /* Handled by parse_dir_options() */ } else if (strcmp(s, "logchan") == 0) { if (!LogChannel) { fprintf(stderr, @@ -246,9 +254,7 @@ static int parse_options(int ac, char **av) } else if (strcmp(s, "protocoldebug") == 0) { protocoldebug = 1; } else if (strcmp(s, "support") == 0) { - nofork = 1; - debug++; - nothird = 1; + /* Handled by parse_dir_options() */ } else if (!strcmp(s, "noexpire")) { noexpire = 1; } else if (!strcmp(s, "help")) { @@ -348,8 +354,6 @@ int init_primary(int ac, char **av) /* Parse command line for -dir and -version options. */ parse_dir_options(ac, av); - /* Parse all remaining command-line options. */ - parse_options(ac, av); /* Chdir to Services data directory. */ if (chdir(services_dir.c_str()) < 0) { @@ -395,6 +399,9 @@ int init_secondary(int ac, char **av) /* Add Core MSG handles */ moduleAddMsgs(); + /* Parse all remaining command-line options. */ + parse_options(ac, av); + /* Parse the defcon mode string if needed */ if (DefConLevel) { if (!defconParseModeString(DefConChanModes)) { |