add -version option to display version and quit

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-08-27 14:20:27 +12:00
parent 7494823b07
commit e0e5c742e3

View File

@ -33,9 +33,15 @@ func main() {
hubsec := flag.String("hubsecurity", "Hub-Security", "Nick used for administrative events")
verbose := flag.Bool("verbose", false, "Display debugging information")
autojoin := flag.Bool("autojoin", true, "Automatically join clients to the channel")
version := flag.Bool("version", false, "Display version and exit")
flag.Parse()
if *version {
log.Printf("%s version %s\n", APP_NAME, APP_VERSION)
return
}
log.Printf("Listening on '%s'...", *ircAddress)
if *autojoin {
log.Printf("Clients will be automatically joined to the channel.")