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

Global flags aren't used/parsed #44

Closed
jbeda opened this issue Jan 14, 2015 · 1 comment
Closed

Global flags aren't used/parsed #44

jbeda opened this issue Jan 14, 2015 · 1 comment

Comments

@jbeda
Copy link

jbeda commented Jan 14, 2015

If someone creates a flag into the pflag.CommandLine flag set, it isn't imported/used/parsed. It should instead be merged with the rest of the persistent flags.

eparis added a commit to eparis/cobra that referenced this issue Mar 19, 2015
Some project pick up flags from of projects the include.  A great
example would be projects that use glog and thus get all of those flags.
Kubernetes, for example, merges those flags manually into it's commands.

This was reported in spf13#44

What this patch does is merge those flags into the PersistentFlags on
the highest parent.  This allows kubernetes to stop having to merge
things themselves...
eparis added a commit to eparis/cobra that referenced this issue Mar 19, 2015
Some project pick up flags from of projects the include.  A great
example would be projects that use glog and thus get all of those flags.
Kubernetes, for example, merges those flags manually into it's commands.

This was reported in spf13#44

What this patch does is merge those flags into the PersistentFlags on
the highest parent.  This allows kubernetes to stop having to merge
things themselves...
eparis added a commit to eparis/cobra that referenced this issue Mar 19, 2015
Some projects pick up flags from other projects they include.  A great
example would be projects that use glog and thus get all of those flags.
Kubernetes, for example, merges those flags manually into its commands.

This was reported in spf13#44

What this patch does is merge those flags into the PersistentFlags on
the highest parent.  This allows kubernetes to stop having to merge
things themselves...
@eparis
Copy link
Collaborator

eparis commented Aug 17, 2015

This is now working!

@eparis eparis closed this as completed Aug 17, 2015
muscliary added a commit to muscliary/cobra that referenced this issue Sep 12, 2023
Some projects pick up flags from other projects they include.  A great
example would be projects that use glog and thus get all of those flags.
Kubernetes, for example, merges those flags manually into its commands.

This was reported in spf13/cobra#44

What this patch does is merge those flags into the PersistentFlags on
the highest parent.  This allows kubernetes to stop having to merge
things themselves...
desdeel2d0m added a commit to desdeel2d0m/cobra that referenced this issue Jul 1, 2024
Some projects pick up flags from other projects they include.  A great
example would be projects that use glog and thus get all of those flags.
Kubernetes, for example, merges those flags manually into its commands.

This was reported in spf13/cobra#44

What this patch does is merge those flags into the PersistentFlags on
the highest parent.  This allows kubernetes to stop having to merge
things themselves...
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

No branches or pull requests

2 participants