Skip to content

Commit

Permalink
added option for version output
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Sep 13, 2016
1 parent c9d1ba4 commit d7dd210
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/rand"
"net"
"net/http"
"os"
"sort"
"sync"
"time"
Expand All @@ -21,6 +22,7 @@ var (
var (
repeats = flag.Int("repeats", 1, "Number of repeats")
useHTTP = flag.Bool("http", false, "Use http transport (default is tcp)")
showVer = flag.Bool("v", false, "Show version")
)

var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
Expand Down Expand Up @@ -141,6 +143,11 @@ func main() {

flag.Parse()

if *showVer {
fmt.Println(version)
os.Exit(0)
}

regions := *CalcLatency(*repeats, *useHTTP)

outFmt := "%5v %-30s %20s\n"
Expand Down

0 comments on commit d7dd210

Please sign in to comment.