diff --git a/go.mod b/go.mod index ed4229c..e367e7e 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/gliderlabs/ssh v0.3.3 github.com/maaslalani/confetty v0.0.0-20211105043600-c1f984adc7d6 github.com/prometheus/client_golang v1.11.0 + github.com/spf13/pflag v1.0.5 ) require ( diff --git a/go.sum b/go.sum index 18fdc03..7b17289 100644 --- a/go.sum +++ b/go.sum @@ -178,6 +178,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/main.go b/main.go index f571908..2de344d 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "flag" "fmt" "log" "runtime/debug" @@ -18,12 +17,13 @@ import ( "github.com/maaslalani/confetty/confetti" "github.com/maaslalani/confetty/fireworks" "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/pflag" ) // nolint: gomnd var ( - port = flag.Int("port", 2222, "port to listen on") - metricsPort = flag.Int("metrics-port", 9222, "port to listen on") + port = pflag.Int("port", 2222, "port to listen on") + metricsPort = pflag.Int("metrics-port", 9222, "port to listen on") ) const ( @@ -32,7 +32,7 @@ const ( ) func main() { - flag.Parse() + pflag.Parse() version := "devel" if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" {