Support outputting version with -v flag

pull/29/head
Matt Baer 6 years ago
parent 58d163d2e0
commit ed1b77ea3b
  1. 6
      app.go

@ -132,13 +132,17 @@ func Serve() {
genKeys := flag.Bool("gen-keys", false, "Generate encryption and authentication keys") genKeys := flag.Bool("gen-keys", false, "Generate encryption and authentication keys")
createSchema := flag.Bool("init-db", false, "Initialize app database") createSchema := flag.Bool("init-db", false, "Initialize app database")
resetPassUser := flag.String("reset-pass", "", "Reset the given user's password") resetPassUser := flag.String("reset-pass", "", "Reset the given user's password")
outputVersion := flag.Bool("v", false, "Output the current version")
flag.Parse() flag.Parse()
debugging = *debugPtr debugging = *debugPtr
app := &app{} app := &app{}
if *createConfig { if *outputVersion {
fmt.Println(serverSoftware + " " + softwareVer)
os.Exit(0)
} else if *createConfig {
log.Info("Creating configuration...") log.Info("Creating configuration...")
c := config.New() c := config.New()
log.Info("Saving configuration...") log.Info("Saving configuration...")

Loading…
Cancel
Save