diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-04-23 02:07:22 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-04-23 02:07:22 +0300 |
commit | b3edc455262b0443ac2baddba96cc2d7e350ef13 (patch) | |
tree | f7804140b125b4d5d3d15f30c5d1e4c167758ea6 | |
parent | 86cbbcb8bd3c62f0e1af0188cf7fb83cb89df6c4 (diff) |
Add version flag (specially für sava)
-rw-r--r-- | telegabber.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/telegabber.go b/telegabber.go index 97a082b..f76fcbe 100644 --- a/telegabber.go +++ b/telegabber.go @@ -15,6 +15,8 @@ import ( goxmpp "gosrc.io/xmpp" ) +const version string = "1.2.1-dev" + var sm *goxmpp.StreamManager var component *goxmpp.Component var err error @@ -28,8 +30,14 @@ func main() { var configPath = flag.String("config", "config.yml", "Config file path") // JSON schema (not for editing by a user) var schemaPath = flag.String("schema", "./config_schema.json", "Schema file path") + var versionFlag = flag.Bool("version", false, "Print the version and exit") flag.Parse() + if *versionFlag { + fmt.Printf("%v\n", version) + os.Exit(0) + } + if *profilingPort > 0 { go func() { log.Println(http.ListenAndServe(fmt.Sprintf("localhost:%v", *profilingPort), nil)) |