Skip to content

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

@fengxsong

Description

@fengxsong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions