Skip to content

Commit 574626a

Browse files
committed
Add -version flag and bump version.
1 parent 0f7ff32 commit 574626a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/reconquest/barely"
2929
)
3030

31-
var version = "1.0"
31+
var version = "1.1"
3232

3333
var (
3434
servicePtr *string
@@ -38,6 +38,8 @@ var (
3838
useHTTPSPtr *bool
3939
throttlePtr *bool
4040
ignoreCertificatePtr *bool
41+
42+
printVersion *bool
4143
)
4244

4345
type service struct {
@@ -180,12 +182,19 @@ func main() {
180182
ignoreCertificatePtr = flag.Bool("insecure", false, "Don't verify the certificate when using HTTPs")
181183
throttlePtr = flag.Bool("throttle", false, "Throttle request speed. (random for a max of 10sec)")
182184

185+
printVersion = flag.Bool("version", false, "Print the version and exit")
186+
183187
flag.Parse()
184188

185189
if !validateFlags() {
186190
return
187191
}
188192

193+
if *printVersion {
194+
fmt.Printf("go-out version %s\n", version)
195+
return
196+
}
197+
189198
fmt.Println("===== Configuration =====")
190199
fmt.Printf("Service: %s\n", *servicePtr)
191200
fmt.Printf("Start Port: %d\n", *startPortPtr)

0 commit comments

Comments
 (0)