func initOptions() { err := command.ParseOptions() if err != nil { switch err.(type) { case *flags.Error: // no need to print error, flags package already does that default: fmt.Println(err.Error()) } os.Exit(1) } options = command.Opts if options.Version { printVersion() os.Exit(0) } if options.ReadOnly { msg := `------------------------------------------------------ SECURITY WARNING: You are running pgweb in read-only mode. This mode is designed for environments where users could potentially delete / change data. For proper read-only access please follow postgresql role management documentation. ------------------------------------------------------` fmt.Println(msg) } printVersion() }
func initOptions() { err := command.ParseOptions() if err != nil { os.Exit(1) } options = command.Opts if options.Version { printVersion() os.Exit(0) } printVersion() }