remove ini parsing

This commit is contained in:
karenzshea
2016-02-12 20:11:35 -05:00
committed by Patrick Niklaus
parent 2679c1cf0a
commit b80e96547e
6 changed files with 57 additions and 192 deletions
+3 -19
View File
@@ -28,13 +28,9 @@ parseArguments(int argc, char *argv[], contractor::ContractorConfig &contractor_
{
// declare a group of options that will be allowed only on command line
boost::program_options::options_description generic_options("Options");
generic_options.add_options()("version,v", "Show version")("help,h", "Show this help message")(
"config,c",
boost::program_options::value<boost::filesystem::path>(&contractor_config.config_file_path)
->default_value("contractor.ini"),
"Path to a configuration file.");
generic_options.add_options()("version,v", "Show version")("help,h", "Show this help message");
// declare a group of options that will be allowed both on command line and in config file
// declare a group of options that will be allowed on command line
boost::program_options::options_description config_options("Configuration");
config_options.add_options()(
"profile,p",
@@ -62,8 +58,7 @@ parseArguments(int argc, char *argv[], contractor::ContractorConfig &contractor_
"Write out edge-weight debugging geometry data in GeoJSON format to this file");
#endif
// hidden options, will be allowed both on command line and in config file, but will not be
// shown to the user
// hidden options, will be allowed on command line, but will not be shown to the user
boost::program_options::options_description hidden_options("Hidden options");
hidden_options.add_options()("input,i", boost::program_options::value<boost::filesystem::path>(
&contractor_config.osrm_input_path),
@@ -77,9 +72,6 @@ parseArguments(int argc, char *argv[], contractor::ContractorConfig &contractor_
boost::program_options::options_description cmdline_options;
cmdline_options.add(generic_options).add(config_options).add(hidden_options);
boost::program_options::options_description config_file_options;
config_file_options.add(config_options).add(hidden_options);
boost::program_options::options_description visible_options(
"Usage: " + boost::filesystem::basename(argv[0]) + " <input.osrm> [options]");
visible_options.add(generic_options).add(config_options);
@@ -92,14 +84,6 @@ parseArguments(int argc, char *argv[], contractor::ContractorConfig &contractor_
.run(),
option_variables);
const auto &temp_config_path = option_variables["config"].as<boost::filesystem::path>();
if (boost::filesystem::is_regular_file(temp_config_path))
{
boost::program_options::store(boost::program_options::parse_config_file<char>(
temp_config_path.string().c_str(), cmdline_options, true),
option_variables);
}
if (option_variables.count("version"))
{
util::SimpleLogger().Write() << OSRM_VERSION;