diff --git a/cmd/inbucket/main.go b/cmd/inbucket/main.go index 88ce6a6..ce6933f 100644 --- a/cmd/inbucket/main.go +++ b/cmd/inbucket/main.go @@ -49,6 +49,7 @@ func init() { func main() { // Command line flags. help := flag.Bool("help", false, "Displays help on flags and env variables.") + versionflag := flag.Bool("version", false, "Displays version.") pidfile := flag.String("pidfile", "", "Write our PID into the specified file.") logfile := flag.String("logfile", "stderr", "Write out log into the specified file.") logjson := flag.Bool("logjson", false, "Logs are written in JSON format.") @@ -64,6 +65,10 @@ func main() { config.Usage() return } + if *versionflag { + fmt.Fprintln(os.Stdout, version) + return + } // Process configuration. config.Version = version