diff options
Diffstat (limited to 'cmd/trains-webui')
-rw-r--r-- | cmd/trains-webui/main.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd/trains-webui/main.go b/cmd/trains-webui/main.go index 76f34ea..0ea3b57 100644 --- a/cmd/trains-webui/main.go +++ b/cmd/trains-webui/main.go @@ -1,14 +1,25 @@ package main import ( + "flag" "log" + "os" "git.adyxax.org/adyxax/trains/internal/webui" "git.adyxax.org/adyxax/trains/pkg/config" ) func main() { - c, err := config.LoadFile("/home/julien/.config/adyxax-trains/config.yaml") + 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) } |