improve compatibility with go/flag#241
Conversation
|
👋 howdy! Some of this looks like it overlaps with my existing PR #220; do you want to pull my commits into your PR?
Following up on this, it looks like |
Absolutely!
I'm also considering simply forking and sprucing everything up at this point, for basically the same reason. |
|
Re: giving pflag a better home: the problem is that cobra doesn't expose a way to drop in another flag library ... unless you all know a trick I don't? |
I am wholly disinterested in cobra. Forks need not only exist as ways to change some "definitive upstream" pointer. |
|
I don't think cobra or viper or any of the other packages steve owns matter here. We're just busy and would love anyone who is consistently able to show good judgement and help maintain things. In this case I'm totally fine with the changes. If @5paceToast and @mckern agree on a PR that is correct I'll merge it. |
go/flag in go 1.13 has a public Output() function and a Name() function - change out() to Output() (adjusting the rest of the file) - add Name() and tests for it From: @mckern (spf13#220) re: out/Output: This brings behavior inline with go's flag library, and allows for printing output directly to whatever the current FlagSet is using for output. This change will make it easier to correctly emit output to stdout or stderr (e.g. a user has requested a help screen, which should emit to stdout since it's the desired outcome).
|
@mckern do you think the merged changes do you sufficient justice? |
|
@5paceToast not quite; there's a test in my commit that's missing here. I took a look at your commit, and cherry-picked it onto @eparis thanks for checking in -- I know y'all are volunteers, and I appreciate your time, attention, and efforts. |
|
Closing in favor of #220. |
go/flag in go 1.13 has a public Output() function and a Name() function