]> git.r.bdr.sh - rbdr/mobius/commitdiff
Add -config flag to client
authorJeff Halter <redacted>
Sun, 5 Jun 2022 22:34:37 +0000 (15:34 -0700)
committerJeff Halter <redacted>
Sun, 5 Jun 2022 22:34:37 +0000 (15:34 -0700)
cmd/mobius-hotline-client/main.go

index ec6f8951eb0380868e6209e0179f2958d9ac988f..6bc2d58bce15bd25d9b3c9a43b96aa8def666def 100644 (file)
@@ -21,6 +21,7 @@ func main() {
        sigChan := make(chan os.Signal, 1)
        signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT, os.Interrupt)
 
+       configDir := flag.String("config", defaultConfigPath(), "Path to config root")
        version := flag.Bool("version", false, "print version and exit")
        logLevel := flag.String("log-level", "info", "Log level")
        logFile := flag.String("log-file", "", "output logs to file")
@@ -70,9 +71,7 @@ func main() {
                cancelRoot()
        }()
 
-       cfgPath := defaultConfigPath()
-
-       client := hotline.NewClient(cfgPath, logger)
+       client := hotline.NewClient(*configDir, logger)
        client.DebugBuf = db
        client.UI.Start()