Fixed formatting in error message (Issue #9)

This commit is contained in:
Pranav Srinivas Kumar 2019-05-01 19:55:40 -04:00
parent a80b960ea3
commit 4d98282e2f

View File

@ -623,7 +623,7 @@ class ArgumentParser {
auto tArgument = mPositionalArguments[i];
if (tArgument->mValues.size() != tArgument->mNumArgs) {
std::cout << "error: " << tArgument->mNames[0] << ": expected "
<< tArgument->mNumArgs << (tArgument->mNumArgs == 1 ? "argument. " : " arguments. ")
<< tArgument->mNumArgs << (tArgument->mNumArgs == 1 ? " argument. " : " arguments. ")
<< tArgument->mValues.size() << " provided.\n" << std::endl;
print_help();
exit(0);
@ -639,7 +639,7 @@ class ArgumentParser {
// If no default value, then there's a problem
if (!tArgument->mDefaultValue.has_value()) {
std::cout << "error: " << tArgument->mNames[0] << ": expected "
<< tArgument->mNumArgs << (tArgument->mNumArgs == 1 ? "argument. " : " arguments. ")
<< tArgument->mNumArgs << (tArgument->mNumArgs == 1 ? " argument. " : " arguments. ")
<< tArgument->mValues.size() << " provided.\n" << std::endl;
print_help();
exit(0);