From 003233d60da4a2b69260642e57757bba48021ca1 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 2 Jan 2022 10:52:15 +0000 Subject: Change config file lookup - Look for both local and global config file - Directly generate the global config file with make install --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index cac5eee..85ee6cc 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ import ( ) var ( - configFile = "/etc/bloat.conf" + configFiles = []string{"bloat.conf", "/etc/bloat.conf"} ) func errExit(err error) { @@ -34,11 +34,11 @@ func main() { for _, opt := range opts { switch opt.Option { case 'f': - configFile = opt.Value + configFiles = []string{opt.Value} } } - config, err := config.ParseFile(configFile) + config, err := config.ParseFiles(configFiles) if err != nil { errExit(err) } -- cgit v1.2.3