Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Adds a flag to print the current version
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaskorhonen committed Apr 1, 2016
1 parent 2d8bbcf commit de56e6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/goadapp/goad"
"github.com/goadapp/goad/helpers"
"github.com/goadapp/goad/queue"
"github.com/goadapp/goad/version"
"github.com/nsf/termbox-go"
)

Expand All @@ -34,6 +35,8 @@ const coldef = termbox.ColorDefault
const nano = 1000000000

func main() {
var printVersion bool

flag.StringVar(&url, "u", "", "URL to load test (required)")
flag.StringVar(&method, "m", "GET", "HTTP method")
flag.StringVar(&body, "b", "", "HTTP request body")
Expand All @@ -43,8 +46,14 @@ func main() {
flag.StringVar(&regions, "r", "us-east-1,eu-west-1,ap-northeast-1", "AWS regions to run in (comma separated, no spaces)")
flag.StringVar(&awsProfile, "p", "", "AWS named profile to use")
flag.Var(&headers, "H", "List of headers")
flag.BoolVar(&printVersion, "version", false, "print the current Goad version")
flag.Parse()

if printVersion {
fmt.Println(version.Version)
os.Exit(0)
}

if url == "" {
flag.Usage()
os.Exit(0)
Expand Down

0 comments on commit de56e6e

Please sign in to comment.