1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 01:27:01 +00:00

inbucket cmd: add version flag (#385)

This commit is contained in:
Shantanu Gadgil
2023-08-31 22:30:41 +05:30
committed by GitHub
parent 06ec140e72
commit f1dadba1b2

View File

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