diff -r 3d65053d01a3 -r 3d14a3449362 lemon/arg_parser.h --- a/lemon/arg_parser.h Tue Jun 10 11:36:17 2008 +0000 +++ b/lemon/arg_parser.h Fri Jun 13 09:51:45 2008 +0000 @@ -310,9 +310,9 @@ operator bool() { Opts::iterator i = _parser._opts.find(_name); - LEMON_ASSERT(i==_parser._opts.end(), + LEMON_ASSERT(i!=_parser._opts.end(), std::string()+"Unkown option: '"+_name+"'"); - LEMON_ASSERT(i->second.type!=ArgParser::BOOL, + LEMON_ASSERT(i->second.type==ArgParser::BOOL, std::string()+"'"+_name+"' is a bool option"); return *(i->second.bool_p); } @@ -320,9 +320,9 @@ operator std::string() { Opts::iterator i = _parser._opts.find(_name); - LEMON_ASSERT(i==_parser._opts.end(), + LEMON_ASSERT(i!=_parser._opts.end(), std::string()+"Unkown option: '"+_name+"'"); - LEMON_ASSERT(i->second.type!=ArgParser::STRING, + LEMON_ASSERT(i->second.type==ArgParser::STRING, std::string()+"'"+_name+"' is a string option"); return *(i->second.string_p); } @@ -330,10 +330,10 @@ operator double() { Opts::iterator i = _parser._opts.find(_name); - LEMON_ASSERT(i==_parser._opts.end(), + LEMON_ASSERT(i!=_parser._opts.end(), std::string()+"Unkown option: '"+_name+"'"); - LEMON_ASSERT(i->second.type!=ArgParser::DOUBLE && - i->second.type!=ArgParser::INTEGER, + LEMON_ASSERT(i->second.type==ArgParser::DOUBLE || + i->second.type==ArgParser::INTEGER, std::string()+"'"+_name+"' is a floating point option"); return i->second.type==ArgParser::DOUBLE ? *(i->second.double_p) : *(i->second.int_p); @@ -342,9 +342,9 @@ operator int() { Opts::iterator i = _parser._opts.find(_name); - LEMON_ASSERT(i==_parser._opts.end(), + LEMON_ASSERT(i!=_parser._opts.end(), std::string()+"Unkown option: '"+_name+"'"); - LEMON_ASSERT(i->second.type!=ArgParser::INTEGER, + LEMON_ASSERT(i->second.type==ArgParser::INTEGER, std::string()+"'"+_name+"' is an integer option"); return *(i->second.int_p); }