-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 Parent FlagSet #1795
base: main
Are you sure you want to change the base?
Add Parent FlagSet #1795
Conversation
Signed-off-by: fahed dorgaa <[email protected]>
@@ -1672,7 +1672,7 @@ func (c *Command) Parent() *Command { | |||
func (c *Command) mergePersistentFlags() { | |||
c.updateParentsPflags() | |||
c.Flags().AddFlagSet(c.PersistentFlags()) | |||
c.Flags().AddFlagSet(c.parentsPflags) | |||
c.Flags().AddParentFlagSet(c.parentsPflags) |
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.
Needs unit testing.
Also, not sure whether changing the default behavior is allowed. Probably this should be configurable.
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.
Can you give a broader description of this change and what use case it's trying to solve?
Also, I'm assuming this is a subset of this PR? spf13/pflag#357 We would need to wait for a new pflag
release and then consume it from the upstream.
The Cobra project currently lacks enough contributors to adequately respond to all PRs. This bot triages issues and PRs according to the following rules:
|
As we have very few maintainers, and those have very little time, we've decided to remove the auto-close configuration. |
|
support pFlag
AddParentFlagSet
(spf13/pflag#357)Signed-off-by: fahed dorgaa [email protected]