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);
|
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") ) {
|
if( !use_shared_memory && option_variables.count("base") ) {
|
||||||
path_iterator = paths.find("base");
|
path_iterator = paths.find("base");
|
||||||
BOOST_ASSERT( paths.end() != path_iterator );
|
BOOST_ASSERT( paths.end() != path_iterator );
|
||||||
@ -277,12 +281,12 @@ inline bool GenerateServerProgramOptions(
|
|||||||
) {
|
) {
|
||||||
path_iterator->second = base_string + ".timestamp";
|
path_iterator->second = base_string + ".timestamp";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( 1 > requested_num_threads ) {
|
SimpleLogger().Write() << visible_options;
|
||||||
throw OSRMException("Number of threads must be a positive number");
|
return false;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PROGRAM_OPTIONS_H */
|
#endif /* PROGRAM_OPTIONS_H */
|
||||||
|
@ -123,6 +123,7 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
if(!option_variables.count("input")) {
|
if(!option_variables.count("input")) {
|
||||||
SimpleLogger().Write(logWARNING) << "No input file specified";
|
SimpleLogger().Write(logWARNING) << "No input file specified";
|
||||||
|
SimpleLogger().Write() << visible_options;
|
||||||
return -1;
|
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/LuaUtil.h"
|
||||||
#include "Util/OpenMPWrapper.h"
|
#include "Util/OpenMPWrapper.h"
|
||||||
#include "Util/OSRMException.h"
|
#include "Util/OSRMException.h"
|
||||||
#include "Util/ProgramOptions.h"
|
// #include "Util/ProgramOptions.h"
|
||||||
#include "Util/SimpleLogger.h"
|
#include "Util/SimpleLogger.h"
|
||||||
#include "Util/StringUtil.h"
|
#include "Util/StringUtil.h"
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
@ -127,14 +127,14 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
boost::program_options::notify(option_variables);
|
boost::program_options::notify(option_variables);
|
||||||
|
|
||||||
if(boost::filesystem::is_regular_file(config_file_path)) {
|
// if(boost::filesystem::is_regular_file(config_file_path)) {
|
||||||
SimpleLogger().Write() << "Reading options from: " << config_file_path.c_str();
|
// SimpleLogger().Write() << "Reading options from: " << config_file_path.c_str();
|
||||||
std::string config_str;
|
// std::string config_str;
|
||||||
PrepareConfigFile( config_file_path.c_str(), config_str );
|
// PrepareConfigFile( config_file_path.c_str(), config_str );
|
||||||
std::stringstream config_stream( 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::store(parse_config_file(config_stream, config_file_options), option_variables);
|
||||||
boost::program_options::notify(option_variables);
|
// boost::program_options::notify(option_variables);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(!option_variables.count("restrictions")) {
|
if(!option_variables.count("restrictions")) {
|
||||||
restrictions_path = std::string( input_path.c_str()) + ".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")) {
|
if(!option_variables.count("input")) {
|
||||||
SimpleLogger().Write(logWARNING) << "No input file specified";
|
SimpleLogger().Write(logWARNING) << "No input file specified";
|
||||||
|
SimpleLogger().Write() << visible_options;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user