-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add unnamed subcommand #216
Conversation
A couple remaining issues |
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 1960 2023 +63
=====================================
+ Hits 1960 2023 +63
Continue to review full report at Codecov.
|
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.
Another idea would be to have two lists of subcommands, named and unnamed, and then looping over one or the other as needed.
Todo yet
|
Question. Should the |
Right now the nameless subcommands get printed with help before a list of subcommands. If a subcommand has a non-default group definition should it do something with that or should the group information on a nameless subcommand be ignored? |
@henryiii If the latest commit passes Codecov I will merge everything to a single commit, unless you see some other things that should be changed. |
Add a few small last minute suggestions you can look at. I'm not sure what an unnamed subcommand should do for "parsed" - it rather seems like setting it to 1 when it is checked (that is, all unnamed subcommands will get a 1) might be an option. Really, a user shouldn't be checking the "count" of an unnamed subcommand, so the only effect would be in the parsing, where it seems like it wasn't needed for tracking unnamed subcommands. |
I think we can tweak the formatting if needed on nameless subcommands after the merge, do what you think is best for now. |
update the readme, and add a formatter test for nameless subcommands in nondefault group with other named subcommands. add a test of default arguments add a formatter test add tests for unnamed subcommands and an example of the partitioned subcommands. change the app_p to be a shared_ptr so you can add an App later on and merge them together add the ability to add unnamed subcommands that allow partitioning on options into multiple apps.
8f702ad
to
255d1a2
Compare
Thanks! |
If merged this pull request will allow unnamed subcommands that get checked for options if no matches occur in the main App. it also allows the extraction and insertion of subcommands via shared_ptr.
See issue #215.