Commit
Author: Noam Preil [noam@pixelhero.dev]
Committer: Drew DeVault [sir@cmpwn.com] Thu, 24 Sep 2020 18:23:43 +0000
Hash: e0436f24b848849cc1082ac96110ec3158f1e90e
Timestamp: Thu, 24 Sep 2020 18:23:43 +0000 (4 years ago)

+4 -0 +/-1 browse
Error out instead of crashing when server isn't specified
1diff --git a/main.go b/main.go
2index e15d079..887ae50 100644
3--- a/main.go
4+++ b/main.go
5 @@ -128,6 +128,10 @@ func metricName(metric map[string]string) string {
6 func main() {
7 plotutil.DefaultDashes = [][]vg.Length{{}}
8
9+ if len(os.Args) < 2 {
10+ fmt.Printf("Usage: %s server\n", os.Args[0])
11+ os.Exit(1)
12+ }
13 upstream = os.Args[1]
14 router := chi.NewRouter()
15 router.Use(middleware.RealIP)