Merge pull request #90 from rysson/issue/89-print_req_if_no_def_val

Fix help if required and def-value. Fixes #89.
This commit is contained in:
Pranav 2020-11-30 13:17:43 -06:00 committed by GitHub
commit d0758e0ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -483,7 +483,7 @@ public:
std::copy(std::begin(argument.mNames), std::end(argument.mNames),
std::ostream_iterator<std::string>(nameStream, " "));
stream << nameStream.str() << "\t" << argument.mHelp;
if (argument.mIsRequired)
if (argument.mIsRequired && !argument.mDefaultValue.has_value())
stream << "[Required]";
stream << "\n";
return stream;