-
Notifications
You must be signed in to change notification settings - Fork 82
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
[FIX, FEATURE] Fix initialising the version_check_option. Add multi-level argument parsing. #1185
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1185 +/- ##
==========================================
+ Coverage 97.3% 97.31% +<.01%
==========================================
Files 219 219
Lines 8803 8832 +29
==========================================
+ Hits 8566 8595 +29
Misses 237 237
Continue to review full report at Codecov.
|
@@ -551,18 +553,18 @@ class argument_parser | |||
{ | |||
format = detail::format_help{false}; | |||
init_standard_options(); | |||
return; | |||
special_format_was_set = true; |
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.
It seems that if you pass multiple special formats (e.g., h and hh), it will overwrite it in the next loop iteration. I think we should either print an error message or always take the first one. Currently it would choose the last argument.
How does that work with nested argument parsers? For nested arg parser the version check argument should refer to the nested inner arg parser if it comes after the keyowrd. I suspect these changes will break that. We really need test-cases for nested arg parsers as it is a commonly used design. |
Sorry to jump into this but what is a nested argument parser? Do we have a snippet or demo/tutorial for this? I can only think of a tool with different configurations who have their own options, e.g.samtools. |
A program with different sub-programs, like
@smehringer said she would write a HowTo at some point (or at least we agreed that we want such a HowTo). Currently we have nothing that tests this, that's why I said new changes threaten to break it. |
Ok, this is what I had in mind already. |
781474d
to
fb93f80
Compare
48bf60c
to
ae138ca
Compare
e22099c
to
4db19ba
Compare
4db19ba
to
c838dfd
Compare
Code coverage complains that format man is not tested 🙄 |
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.
In general: is "multi-level arg parser" the best name? Does this pattern have a name that other projects / arg-parsers use? Maybe "nested" is better?
doc/howto/multi_level_argument_parser/multi_level_arg_parse.cpp
Outdated
Show resolved
Hide resolved
c838dfd
to
12de76e
Compare
bd7b893
to
6a5139d
Compare
@h-2 why did you remove your review? 🙀 EDIT: ok ok the ONE comment |
I remove my review request not because I am pissed, just so that I know which of the items in the list is actually waiting for me and not me waiting on the other person 😉 |
I know, I just thought it is because of the code coverage that bites me any time I do something on the argument parser 😇 |
6a5139d
to
cff70e1
Compare
cff70e1
to
f3a8f3c
Compare
Resolves #1177