No longer hard crash datastore on unrecognised options
This commit is contained in:
parent
c7a1576100
commit
fb4834458e
@ -85,7 +85,7 @@ return_code parseArguments(int argc, char *argv[], contractor::ContractorConfig
|
|||||||
.run(),
|
.run(),
|
||||||
option_variables);
|
option_variables);
|
||||||
}
|
}
|
||||||
catch (boost::program_options::error &e)
|
catch (const boost::program_options::error &e)
|
||||||
{
|
{
|
||||||
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
||||||
return return_code::fail;
|
return return_code::fail;
|
||||||
|
@ -82,7 +82,7 @@ return_code parseArguments(int argc, char *argv[], extractor::ExtractorConfig &e
|
|||||||
.run(),
|
.run(),
|
||||||
option_variables);
|
option_variables);
|
||||||
}
|
}
|
||||||
catch (boost::program_options::error &e)
|
catch (const boost::program_options::error &e)
|
||||||
{
|
{
|
||||||
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
||||||
return return_code::fail;
|
return return_code::fail;
|
||||||
|
@ -130,7 +130,7 @@ inline unsigned generateServerProgramOptions(const int argc,
|
|||||||
.run(),
|
.run(),
|
||||||
option_variables);
|
option_variables);
|
||||||
}
|
}
|
||||||
catch (boost::program_options::error &e)
|
catch (const boost::program_options::error &e)
|
||||||
{
|
{
|
||||||
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
||||||
return INIT_FAILED;
|
return INIT_FAILED;
|
||||||
|
@ -50,11 +50,20 @@ bool generateDataStoreOptions(const int argc,
|
|||||||
|
|
||||||
// parse command line options
|
// parse command line options
|
||||||
boost::program_options::variables_map option_variables;
|
boost::program_options::variables_map option_variables;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
boost::program_options::store(boost::program_options::command_line_parser(argc, argv)
|
boost::program_options::store(boost::program_options::command_line_parser(argc, argv)
|
||||||
.options(cmdline_options)
|
.options(cmdline_options)
|
||||||
.positional(positional_options)
|
.positional(positional_options)
|
||||||
.run(),
|
.run(),
|
||||||
option_variables);
|
option_variables);
|
||||||
|
}
|
||||||
|
catch (const boost::program_options::error &e)
|
||||||
|
{
|
||||||
|
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (option_variables.count("version"))
|
if (option_variables.count("version"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user