mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
prettier output in case of absence of arg help msg
This commit is contained in:
parent
4de9f89b59
commit
b025166e4c
@ -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())
|
||||
if (argument.mDefaultValue.has_value()) {
|
||||
if (!argument.mHelp.empty())
|
||||
stream << " ";
|
||||
stream << "[default: " << argument.mDefaultValueRepr << "]";
|
||||
}
|
||||
stream << "\n";
|
||||
return stream;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user