}
}
-bool ArgvMap::preParseFile(const char *fname, const string &arg)
+bool ArgvMap::preParseFile(const char *fname, const string &arg, const string& theDefault)
{
- params[arg].clear();
+ params[arg]=theDefault;
ifstream f(fname);
if(!f)
parse(argc,argv,true);
}
void preParse(int &argc, char **argv, const string &arg); //!< use this to preparse a single var
- bool preParseFile(const char *fname, const string &arg); //!< use this to preparse a single var in configuration
+ bool preParseFile(const char *fname, const string &arg, const string& theDefault=""); //!< use this to preparse a single var in configuration
bool file(const char *fname, bool lax=false); //!< Parses a file with parameters
bool laxFile(const char *fname)
L<<Logger::Warning<<"Unable to re-parse configuration file '"<<configname<<"'"<<endl;
::arg().preParseFile(configname.c_str(), "auth-zones");
- ::arg().preParseFile(configname.c_str(), "export-etc-hosts");
+ ::arg().preParseFile(configname.c_str(), "export-etc-hosts", "off");
::arg().preParseFile(configname.c_str(), "serve-rfc1918");
parseAuthAndForwards();