From 3cb25965e183c4298ada71de68f1629f6127c3a9 Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 22 Jun 2010 14:35:10 +0000 Subject: [PATCH] Don't accept extra arguments to znc as a config file name It's much wiser to specify a whole --datadir because two znc instances running on the same datadir but different configs just calls for problems. Patch by DarthGandalf, some messing by me, idea by various. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2037 726aef4b-f618-498e-8847-2d620e286838 --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index c3754201..666cd8c6 100644 --- a/main.cpp +++ b/main.cpp @@ -27,7 +27,7 @@ static const struct option g_LongOpts[] = { }; static void GenerateHelp(const char *appname) { - CUtils::PrintMessage("USAGE: " + CString(appname) + " [options] [config]"); + CUtils::PrintMessage("USAGE: " + CString(appname) + " [options]"); CUtils::PrintMessage("Options are:"); CUtils::PrintMessage("\t-h, --help List available command line options (this page)"); CUtils::PrintMessage("\t-v, --version Output version information and exit"); @@ -160,7 +160,9 @@ int main(int argc, char** argv) { } if (optind < argc) { - sConfig = argv[optind]; + CUtils::PrintError("Specifying a config file as an argument isn't supported anymore."); + CUtils::PrintError("Use --datadir instead."); + return 1; } CZNC* pZNC = &CZNC::Get(); @@ -303,7 +305,6 @@ int main(int argc, char** argv) { NULL, NULL, NULL, - NULL, NULL }; int pos = 3; @@ -315,7 +316,6 @@ int main(int argc, char** argv) { args[pos++] = strdup("--no-color"); if (bAllowRoot) args[pos++] = strdup("--allow-root"); - args[pos++] = strdup(pZNC->GetConfigFile().c_str()); // The above code adds 4 entries to args tops // which means the array should be big enough