File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,16 @@ import (
19
19
"github.com/prometheus/exporter-toolkit/web"
20
20
)
21
21
22
- // AddFlags adds the flags used by this package to the Kingpin application.
22
+ type flagGroup interface {
23
+ Flag (string , string ) * kingpin.FlagClause
24
+ }
25
+
26
+ var _ flagGroup = & kingpin.Application {}
27
+
28
+ // AddFlags adds the flags used by this package to the Kingpin application or CmdClause.
23
29
// To use the default Kingpin application, call
24
30
// AddFlags(kingpin.CommandLine, ":portNum") where portNum is the default port.
25
- func AddFlags (a * kingpin. Application , defaultAddress string ) * web.FlagConfig {
31
+ func AddFlags (a flagGroup , defaultAddress string ) * web.FlagConfig {
26
32
systemdSocket := func () * bool { b := false ; return & b }() // Socket activation only available on Linux
27
33
if runtime .GOOS == "linux" {
28
34
systemdSocket = a .Flag (
You can’t perform that action at this time.
0 commit comments