-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implements column-aligned multi-line help message for arguments #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (1/1)
} | ||
prev += pos - prev + 1; | ||
} | ||
if (first_line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statement should be inside braces
if (first_line) | |
if (first_line) { |
} | ||
if (first_line) | ||
stream << "\t" << argument.m_help; | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statement should be inside braces
else { | |
} else { |
stream << "\t" << argument.m_help; | ||
else { | ||
auto leftover = argument.m_help.substr(prev, argument.m_help.size() - prev); | ||
if (leftover.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the empty
method should be used to check for emptiness instead of size
if (leftover.size() > 0) { | |
if (!leftover.empty()) { |
Please fix these minor clang-tidy issues and then we can merge it in 👍 |
Hi, I'd like to provide this little implementation regarding column-aligned multi-line help message that works for arguments (not subcommands). This was discussed in #248 but the original poster didn't open a pull request.
In test_help.cpp I didn't see a test that validates the help message on a per-character level, so I didn't write any test.