mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Merge pull request #79 from bufferbase/patch-1
Fix incorrect message when mUsedName is empty
This commit is contained in:
commit
37264dc7f8
@ -452,8 +452,10 @@ public:
|
||||
} else {
|
||||
if (mValues.size() != expected && !mDefaultValue.has_value()) {
|
||||
std::stringstream stream;
|
||||
stream << mUsedName << ": expected " << *expected << " argument(s). "
|
||||
<< mValues.size() << " provided.";
|
||||
if (!mUsedName.empty())
|
||||
stream << mUsedName << ": ";
|
||||
stream << *expected << " argument(s) expected. " << mValues.size()
|
||||
<< " provided.";
|
||||
throw std::runtime_error(stream.str());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user