Commit c5ba95ee authored by Clayton Coleman's avatar Clayton Coleman

Add Type() method on flags for compat with pflag library

Allows our flag objects to be used with both golang flags and pflags
parent 244d55b0
......@@ -33,3 +33,7 @@ func (sl *StringList) Set(value string) error {
}
return nil
}
func (*StringList) Type() string {
return "stringList"
}
......@@ -37,6 +37,10 @@ func (ip *IP) Set(value string) error {
return nil
}
func (*IP) Type() string {
return "ip"
}
// IPNet adapts net.IPNet for use as a flag.
type IPNet net.IPNet
......@@ -53,3 +57,7 @@ func (ipnet *IPNet) Set(value string) error {
*ipnet = IPNet(*n)
return nil
}
func (*IPNet) Type() string {
return "ipNet"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment