mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 15:39:02 +00:00
throw an error if the --fallback syntax is wrong
This commit is contained in:
parent
329ba24eab
commit
de510d445b
@ -71,8 +71,8 @@ void validate(boost::any &v, std::vector<std::string> const &tokens, FallbackMap
|
|||||||
for(std::vector<std::string>::const_iterator it=tokens.begin(); it != tokens.end(); it++)
|
for(std::vector<std::string>::const_iterator it=tokens.begin(); it != tokens.end(); it++)
|
||||||
{
|
{
|
||||||
int sep = it->find(",");
|
int sep = it->find(",");
|
||||||
if(sep < 1)
|
if(sep < 1 || sep = it->length()-1)
|
||||||
continue;
|
throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value);
|
||||||
|
|
||||||
std::string key(it->substr(0,sep));
|
std::string key(it->substr(0,sep));
|
||||||
std::string value(it->substr(sep+1));
|
std::string value(it->substr(sep+1));
|
||||||
|
Loading…
Reference in New Issue
Block a user