Do not validate values for options without value

This commit is contained in:
LordGrey 2023-10-23 21:08:05 +02:00
parent a5625cf984
commit 7aa1cd87ea

View File

@ -14,7 +14,9 @@ bool Parser::parse(const QStringList &arguments)
return false;
}
for(Option * option : _options)
for(Option * option : std::as_const(_options))
{
if (!option->valueName().isEmpty())
{
QString value = this->value(*option);
if (!option->validate(*this, value)) {
@ -29,6 +31,7 @@ bool Parser::parse(const QStringList &arguments)
return false;
}
}
}
return true;
}