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

Support importing existing flag package flags #12

Open
jbeda opened this issue Jan 13, 2015 · 1 comment
Open

Support importing existing flag package flags #12

jbeda opened this issue Jan 13, 2015 · 1 comment

Comments

@jbeda
Copy link

jbeda commented Jan 13, 2015

This is important for packages (like https://github.com/golang/glog) where the flags are embedded deeply into the code.

I already have this supported in kubernetes here that we can borrow/steal:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/util/plog_import.go

(I typo'd the name of that file and I'll fix it up soon).

This would be a lot easier if the pflag.Value.Type didn't exist or was an extended optional interface. It is unclear why that is there and where it is used.

@ogier
Copy link
Owner

ogier commented Feb 15, 2015

pflag.Value.Type isn't something I'm aware of. I think this is something @spf13 added, but adding methods to Go interfaces is a pretty strong backwards incompatibility because it can make existing types no longer satisfy interfaces they expect to.

I agree that this should be an additional optional interface if it exists at all.

ThinkChaos pushed a commit to ThinkChaos/pflag that referenced this issue Feb 28, 2022
Add support to short form with equal sign: -p=value
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