Use Argument::varValueCount everywhere

experiment/srcref_basic_cfg
Martchus 5 years ago
parent 6bc97e5b16
commit cc09fdc35f
  1. 2
      application/argumentparser.cpp
  2. 2
      application/argumentparser.h

@ -1320,7 +1320,7 @@ void ArgumentParser::checkConstraints(const ArgumentVector &args)
for (const auto &name : arg->m_valueNames) {
ss << ' ' << name, ++valueNamesPrint;
}
if (arg->m_requiredValueCount != static_cast<size_t>(-1)) {
if (arg->m_requiredValueCount != Argument::varValueCount) {
while (valueNamesPrint < arg->m_requiredValueCount) {
ss << "\nvalue " << (++valueNamesPrint);
}

@ -483,7 +483,7 @@ inline void Argument::appendValueName(const char *valueName)
*/
inline bool Argument::allRequiredValuesPresent(std::size_t occurrence) const
{
return m_requiredValueCount == static_cast<std::size_t>(-1)
return m_requiredValueCount == Argument::varValueCount
|| (m_occurrences[occurrence].values.size() >= static_cast<std::size_t>(m_requiredValueCount));
}

Loading…
Cancel
Save