Skip to content

Commit

Permalink
Show usage if no field spec is given
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Mar 12, 2018
1 parent e407187 commit 575aa9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ func main() {
}
interval := flag.Duration("interval", time.Second, "Sampling interval")
flag.Parse()

if len(flag.Args()) == 0 {
flag.Usage()
os.Exit(1)
}

fields, err := aggr.NewFields(flag.Args())
if err != nil {
fatal("invalid argument: ", err)
Expand Down

0 comments on commit 575aa9c

Please sign in to comment.