provide better feedback on command lines
This commit is contained in:
parent
791f475168
commit
9483b781e2
@ -201,6 +201,10 @@ inline bool GenerateServerProgramOptions(
|
||||
boost::program_options::notify(option_variables);
|
||||
}
|
||||
|
||||
if( 1 > requested_num_threads ) {
|
||||
throw OSRMException("Number of threads must be a positive number");
|
||||
}
|
||||
|
||||
if( !use_shared_memory && option_variables.count("base") ) {
|
||||
path_iterator = paths.find("base");
|
||||
BOOST_ASSERT( paths.end() != path_iterator );
|
||||
@ -277,12 +281,12 @@ inline bool GenerateServerProgramOptions(
|
||||
) {
|
||||
path_iterator->second = base_string + ".timestamp";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if( 1 > requested_num_threads ) {
|
||||
throw OSRMException("Number of threads must be a positive number");
|
||||
}
|
||||
return true;
|
||||
SimpleLogger().Write() << visible_options;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* PROGRAM_OPTIONS_H */
|
||||
|
@ -123,6 +123,7 @@ int main (int argc, char *argv[]) {
|
||||
|
||||
if(!option_variables.count("input")) {
|
||||
SimpleLogger().Write(logWARNING) << "No input file specified";
|
||||
SimpleLogger().Write() << visible_options;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
19
prepare.cpp
19
prepare.cpp
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Util/LuaUtil.h"
|
||||
#include "Util/OpenMPWrapper.h"
|
||||
#include "Util/OSRMException.h"
|
||||
#include "Util/ProgramOptions.h"
|
||||
// #include "Util/ProgramOptions.h"
|
||||
#include "Util/SimpleLogger.h"
|
||||
#include "Util/StringUtil.h"
|
||||
#include "typedefs.h"
|
||||
@ -127,14 +127,14 @@ int main (int argc, char *argv[]) {
|
||||
|
||||
boost::program_options::notify(option_variables);
|
||||
|
||||
if(boost::filesystem::is_regular_file(config_file_path)) {
|
||||
SimpleLogger().Write() << "Reading options from: " << config_file_path.c_str();
|
||||
std::string config_str;
|
||||
PrepareConfigFile( config_file_path.c_str(), config_str );
|
||||
std::stringstream config_stream( config_str );
|
||||
boost::program_options::store(parse_config_file(config_stream, config_file_options), option_variables);
|
||||
boost::program_options::notify(option_variables);
|
||||
}
|
||||
// if(boost::filesystem::is_regular_file(config_file_path)) {
|
||||
// SimpleLogger().Write() << "Reading options from: " << config_file_path.c_str();
|
||||
// std::string config_str;
|
||||
// PrepareConfigFile( config_file_path.c_str(), config_str );
|
||||
// std::stringstream config_stream( config_str );
|
||||
// boost::program_options::store(parse_config_file(config_stream, config_file_options), option_variables);
|
||||
// boost::program_options::notify(option_variables);
|
||||
// }
|
||||
|
||||
if(!option_variables.count("restrictions")) {
|
||||
restrictions_path = std::string( input_path.c_str()) + ".restrictions";
|
||||
@ -142,6 +142,7 @@ int main (int argc, char *argv[]) {
|
||||
|
||||
if(!option_variables.count("input")) {
|
||||
SimpleLogger().Write(logWARNING) << "No input file specified";
|
||||
SimpleLogger().Write() << visible_options;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user