Skip to content

Commit 78f0a09

Browse files
author
r.khavronenko
committed
add version
1 parent 1a51228 commit 78f0a09

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ import (
1919
"golang.org/x/crypto/acme/autocert"
2020
)
2121

22-
var configFile = flag.String("config", "", "Proxy configuration filename")
22+
var (
23+
configFile = flag.String("config", "", "Proxy configuration filename")
24+
v = flag.Bool("v", false, "Prints current version and exits")
25+
)
2326

2427
var (
28+
version = "1.1.0"
29+
2530
proxy = newReverseProxy()
2631

2732
allowedNetworksHTTP atomic.Value
@@ -31,7 +36,12 @@ var (
3136

3237
func main() {
3338
flag.Parse()
39+
if *v {
40+
fmt.Printf("Version %s\n", version)
41+
os.Exit(0)
42+
}
3443

44+
log.Infof("Chproxy version: %s", version)
3545
log.Infof("Loading config: %s", *configFile)
3646
cfg, err := reloadConfig()
3747
if err != nil {

0 commit comments

Comments
 (0)