Skip to content
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

Feature: subcommands flags inherence #18

Merged
merged 2 commits into from
Sep 4, 2022

Conversation

thetechpanda
Copy link
Contributor

Implements flags inheritance from parent command.


t.Run("Run inheritFlags()", func(t *testing.T) {
s := c.NewSubCommandInheritFlags("name", "description")
s.inheritFlags(c.flags)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test that the flag is actually on s and t.Fail() if it is not 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added tests for both NewSubCommandInheritFlags() and inheritFlags()

@leaanthony
Copy link
Owner

Looking good my friend 👍 Just a little comment on the test but LGTM 🚀

@leaanthony
Copy link
Owner

Awesome! Thanks man!

@leaanthony leaanthony merged commit 9b3872f into leaanthony:master Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants