-
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 needs to subcommand #317
Conversation
|
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
==========================================
- Coverage 100% 99.74% -0.26%
==========================================
Files 12 12
Lines 3038 3091 +53
==========================================
+ Hits 3038 3083 +45
- Misses 0 8 +8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
======================================
Coverage 100% 100%
======================================
Files 12 12
Lines 3048 3175 +127
======================================
+ Hits 3048 3175 +127
Continue to review full report at Codecov.
|
04540db
to
c854569
Compare
I have run into a few issues with the interaction of needs and the callback operations and the fallthrough flag. Still working on how to resolve these, but it will probably be a few days before things come together. |
This PR should also address #284 when finished |
#272 is also addressed, since the aliases needed to be checked as well |
In considering Aliases, there is a possibility of conflict with existing subcommands and ignore_case, ignore underscore variants of such. This required somewhat more complicated checking of the subcommand names. But also in exploring it the ignore_case, ignore_underscore, name functions also did not currently check this, which means it was possible to generate conflicts. So these checks were added and those functions were made exception safe. more testing is required |
@henryiii I have been adding checks to make sure subcommands don't overlap in name or alias. Options
|
@henryiii We would need a decision on 1,2 or 3 from the previous question to be able to move forward. I don't really have a strong preference either way. I was inclined towards option 1, but that would break an existing test case. |
So what I ended up doing with regard to subcommand names, is disable the check if the subcommand is disabled. So if the existing behavior is needed there is a means of allowing it, but in general it would trigger an error. |
@henryiii I think something is wrong with the travis gcc 4.8 build and the azure clang 3.4 builds |
9674c45
to
fff91ca
Compare
What's the current status? Do you think it's ready for a final review and merge? |
…ns on the Option excludes function
…ubcommands and aliases
…o include the offending name
fff91ca
to
a460029
Compare
I think so, I haven't found anything I have wanted to change in a while. I think there is a possibility of more work needed on the help output in relation to the changes from this PR, but I really don't know the best way to present that information yet and I think it will take some experience using it to know for sure. |
I think it looks good enough to merge. We can adjust things like help output in the future. |
This PR will address #291 and #288
it adds a needs function for subcommands and options to the app as well as a remove needs. it also adds some alias operations to app so multiple subcommand names can represent a single subcommand.
This will also work for nameless subcommands(option_groups) so the same group can be a subcommand or act just like regular options.