Specify the persistence path using the command line

This commit is contained in:
Marc Di Luzio 2020-06-02 16:10:45 +01:00
parent c085e56954
commit 5033ec4e63
5 changed files with 36 additions and 18 deletions

View file

@ -13,6 +13,7 @@ import (
var ver = flag.Bool("version", false, "Display version number")
var port = flag.Int("port", 8080, "The port to host on")
var data = flag.String("data", "/tmp/", "Directory to store persistant data")
func main() {
flag.Parse()
@ -24,7 +25,7 @@ func main() {
s := server.NewServer(
server.OptionPort(*port),
server.OptionPersistentData())
server.OptionPersistentData(*data))
fmt.Println("Initialising...")
if err := s.Initialise(); err != nil {