Skip to content

Commit

Permalink
feat: switch to pflags
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Jul 25, 2022
1 parent 00d744c commit 2647a46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"
"log"
"runtime/debug"
Expand All @@ -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 (
Expand All @@ -32,7 +32,7 @@ const (
)

func main() {
flag.Parse()
pflag.Parse()

version := "devel"
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" {
Expand Down

0 comments on commit 2647a46

Please sign in to comment.