Commit e0cfc0cc authored by morozov.andrey's avatar morozov.andrey

fixed bug with incorrect syntax in CommandLineParser

parent 729d76ad
...@@ -185,13 +185,21 @@ CommandLineParser::CommandLineParser(int argc, const char* const argv[], const s ...@@ -185,13 +185,21 @@ CommandLineParser::CommandLineParser(int argc, const char* const argv[], const s
p.def_value = l[1]; p.def_value = l[1];
p.help_message = impl->cat_string(l[2]); p.help_message = impl->cat_string(l[2]);
p.number = -1; p.number = -1;
if (p.keys[0][0] == '@') if (p.keys.size() <= 0)
{ {
p.number = jj; impl->error = true;
jj++; impl->error_message = "Field KEYS could not be empty\n";
} }
else
{
if (p.keys[0][0] == '@')
{
p.number = jj;
jj++;
}
impl->data.push_back(p); impl->data.push_back(p);
}
} }
// parse argv // parse argv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment