-
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
Allow check if ArgumentParser has parsed values #218
Conversation
This allows checking whether user input was processed into the parser or any attached subparsers. Closes p-ranav#212 Signed-off-by: Sean Robinson <[email protected]>
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)
return it.second; | ||
}); | ||
|
||
return m_is_parsed && (arg_used || subparser_used); |
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.
@skrobinson Why don't we use just m_is_parsed
? I have a subcommand without arguments and operator bool()
returns false for it.
@SergiusTheBest The question I'm trying to answer with this For the case where subparsers are commands and don't require any arguments the |
@skrobinson I understand. But it's not so obvious as |
@skrobinson BTW, is a test case required for contributing? I'd like to add |
Test cases are encouraged. You could probably add to and adapt tests in I believe your new overload is a good idea. |
Ok, thanks for the hint. |
No description provided.