From 35798840f43099b3f64aa025d2a69ee1a3a9e15b Mon Sep 17 00:00:00 2001 From: merlindorin Date: Mon, 22 Jul 2024 23:42:10 +0200 Subject: [PATCH] feat: add config from file --- cmd/exporter-unifi-protect/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/exporter-unifi-protect/main.go b/cmd/exporter-unifi-protect/main.go index 20cd8ba..021e791 100644 --- a/cmd/exporter-unifi-protect/main.go +++ b/cmd/exporter-unifi-protect/main.go @@ -3,6 +3,8 @@ package main import ( _ "embed" + kongyaml "github.com/alecthomas/kong-yaml" + "github.com/alecthomas/kong" "github.com/hoomy-official/exporter-unifi-protect/cmd/exporter-unifi-protect/commads" c "github.com/hoomy-official/go-shared/pkg/cmd" @@ -37,6 +39,7 @@ func main() { kong.Name(name), kong.Description(description), kong.UsageOnError(), + kong.Configuration(kongyaml.Loader, "/etc/unifi-protect/config.yaml", "~/.hoomy/unifi-protect.yaml"), ) ctx.FatalIfErrorf(ctx.Run(cli.Commons))