package main

import (
	"flag"
	"log"

	"infinite-noodle/internal/app"
)

func main() {
	cfg := app.Config{}
	flag.StringVar(&cfg.DataPath, "data", "./infinite.db", "Path to database.")
	flag.StringVar(&cfg.Host, "host", "0.0.0.0", "Host to listen on.")
	flag.IntVar(&cfg.Port, "port", 7878, "Port to listen on.")
	flag.BoolVar(&cfg.RunTest, "test", false, "Run data test")
	flag.Parse()

	if err := app.Run(cfg); err != nil {
		log.Fatal(err)
	}
}
