Skip to content

Commit

Permalink
Error out instead of crashing when server isn't specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Preil authored and ddevault committed Oct 5, 2020
1 parent d5eacb2 commit e0436f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func metricName(metric map[string]string) string {
func main() {
plotutil.DefaultDashes = [][]vg.Length{{}}

if len(os.Args) < 2 {
fmt.Printf("Usage: %s server\n", os.Args[0])
os.Exit(1)
}
upstream = os.Args[1]
router := chi.NewRouter()
router.Use(middleware.RealIP)
Expand Down

0 comments on commit e0436f2

Please sign in to comment.