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))