mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
inbucket cmd: add version flag (#385)
This commit is contained in:
@@ -49,6 +49,7 @@ func init() {
|
|||||||
func main() {
|
func main() {
|
||||||
// Command line flags.
|
// Command line flags.
|
||||||
help := flag.Bool("help", false, "Displays help on flags and env variables.")
|
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.")
|
pidfile := flag.String("pidfile", "", "Write our PID into the specified file.")
|
||||||
logfile := flag.String("logfile", "stderr", "Write out log 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.")
|
logjson := flag.Bool("logjson", false, "Logs are written in JSON format.")
|
||||||
@@ -64,6 +65,10 @@ func main() {
|
|||||||
config.Usage()
|
config.Usage()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if *versionflag {
|
||||||
|
fmt.Fprintln(os.Stdout, version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Process configuration.
|
// Process configuration.
|
||||||
config.Version = version
|
config.Version = version
|
||||||
|
|||||||
Reference in New Issue
Block a user