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

feat: function exporter-toolkit/web/kingpinflag.AddFlags and common/promlog/flag.AddFlags support kingpin.CmdClause as argument #234

Closed
fengxsong opened this issue Aug 9, 2024 · 1 comment · Fixed by #238

Comments

@fengxsong
Copy link
Contributor

Currently those two functions only accept *kingpin.Application as the first argument, When we use these methods in subcommands, we must wrap them again instead of calling them directly. here's a proposal

type flagGroup interface {
	Flag(string, string) *kingpin.FlagClause
}

func AddFlags(a flagGroup, defaultAddress string) *web.FlagConfig ...

func AddFlags(a flagGroup, config *promlog.Config) ...

This change won't impact existing method calls and ensures compatibility.

@metalmatze
Copy link
Member

It's probably easiest if you send a PR directly. Thanks!

fengxsong added a commit to fengxsong/exporter-toolkit that referenced this issue Aug 26, 2024
Signed-off-by: fengxusong <fengxsong@outlook.com>
SuperQ pushed a commit that referenced this issue Sep 1, 2024
Signed-off-by: fengxusong <fengxsong@outlook.com>
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 a pull request may close this issue.

2 participants