aboutsummaryrefslogtreecommitdiff
path: root/cmd/trains-webui/main.go
blob: 0ea3b5778923d3f98e297566d24391179f3a934f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
	"flag"
	"log"
	"os"

	"git.adyxax.org/adyxax/trains/internal/webui"
	"git.adyxax.org/adyxax/trains/pkg/config"
)

func main() {
	path := flag.String("c", os.Getenv("HOME")+"/.config/trains/config.yaml", "configuration file path")
	help := flag.Bool("h", false, "display this help message")
	flag.Parse()

	if *help {
		flag.Usage()
		os.Exit(0)
	}

	c, err := config.LoadFile(*path)
	if err != nil {
		log.Fatal(err)
	}
	webui.Run(c)
}