Fixed minor bug involving combined switch error messages: now they're consistent.

This commit is contained in:
mes5k 2005-01-23 22:29:10 +00:00
parent 69e038b365
commit 266a86b84d

View File

@ -45,7 +45,6 @@ class SwitchArg : public Arg
*/ */
bool _value; bool _value;
public: public:
/** /**
@ -108,6 +107,7 @@ class SwitchArg : public Arg
* Returns bool, whether or not the switch has been set. * Returns bool, whether or not the switch has been set.
*/ */
bool getValue(); bool getValue();
}; };
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -179,7 +179,7 @@ inline bool SwitchArg::processArg(int *i, std::vector<std::string>& args)
if ( argMatches( args[*i] ) ) if ( argMatches( args[*i] ) )
ret = true; ret = true;
if ( _alreadySet ) if ( _alreadySet || ( !ret && combinedSwitchesMatch( args[*i] ) ) )
throw(CmdLineParseException("Argument already set!", toString())); throw(CmdLineParseException("Argument already set!", toString()));
_alreadySet = true; _alreadySet = true;