Skip to content

Commit de56e6e

Browse files
Adds a flag to print the current version
1 parent 2d8bbcf commit de56e6e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cli/cli.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/goadapp/goad"
1616
"github.com/goadapp/goad/helpers"
1717
"github.com/goadapp/goad/queue"
18+
"github.com/goadapp/goad/version"
1819
"github.com/nsf/termbox-go"
1920
)
2021

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

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

52+
if printVersion {
53+
fmt.Println(version.Version)
54+
os.Exit(0)
55+
}
56+
4857
if url == "" {
4958
flag.Usage()
5059
os.Exit(0)

0 commit comments

Comments
 (0)