prettier output in case of absence of arg help msg

This commit is contained in:
Mike Zozu 2020-12-15 19:09:08 +03:00
parent 4de9f89b59
commit b025166e4c

View File

@ -537,8 +537,11 @@ public:
stream << nameStream.str() << "\t" << argument.mHelp;
if (argument.mIsRequired && !argument.mDefaultValue.has_value())
stream << "[Required]";
if (argument.mDefaultValue.has_value())
stream << " [default: " << argument.mDefaultValueRepr << "]";
if (argument.mDefaultValue.has_value()) {
if (!argument.mHelp.empty())
stream << " ";
stream << "[default: " << argument.mDefaultValueRepr << "]";
}
stream << "\n";
return stream;
}