diff --git a/modules/core/src/command_line_parser.cpp b/modules/core/src/command_line_parser.cpp index 7a0284f75..8b7fcad6b 100644 --- a/modules/core/src/command_line_parser.cpp +++ b/modules/core/src/command_line_parser.cpp @@ -41,6 +41,8 @@ static String get_type_name(int type) { if( type == Param::INT ) return "int"; + if( type == Param::BOOLEAN ) + return "bool"; if( type == Param::UNSIGNED_INT ) return "unsigned"; if( type == Param::UINT64 ) @@ -59,6 +61,13 @@ static void from_str(const String& str, int type, void* dst) std::stringstream ss(str.c_str()); if( type == Param::INT ) ss >> *(int*)dst; + else if( type == Param::BOOLEAN ) + { + std::string temp; + ss >> temp; + if( !temp.compare("true") ) *(bool*)dst = true; + else *(bool*)dst = false; + } else if( type == Param::UNSIGNED_INT ) ss >> *(unsigned*)dst; else if( type == Param::UINT64 )