Add support for CLI option --conf.

This commit is contained in:
Arthur Britto
2012-06-11 20:54:05 -07:00
parent 72660369de
commit 253df289c3
3 changed files with 32 additions and 20 deletions

View File

@@ -82,7 +82,7 @@ int main(int argc, char* argv[])
po::options_description desc("Options");
desc.add_options()
("help,h", "Display this message.")
("conf", "Specify the configuration file.")
("conf", po::value<std::string>(), "Specify the configuration file.")
("rpc", "Perform rpc command (default).")
("test,t", "Perform unit tests.")
("parameters", po::value< vector<string> >(), "Specify comma separated parameters.")
@@ -95,7 +95,6 @@ int main(int argc, char* argv[])
//
// Prepare to run
//
theConfig.load();
if (!AddSystemEntropy())
{
@@ -127,6 +126,11 @@ int main(int argc, char* argv[])
}
}
if (!iResult)
{
theConfig.setup(vm.count("conf") ? vm["conf"].as<std::string>() : "");
}
if (iResult)
{
nothing();