aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2022-01-02 10:52:15 +0000
committerr <r@freesoftwareextremist.com>2022-01-02 10:55:26 +0000
commit003233d60da4a2b69260642e57757bba48021ca1 (patch)
tree2d429cdfb05c4473523538aef692f268020b0d40 /main.go
parent21ef7a66106958bd61534e5d0603b447e6fe306d (diff)
downloadbloat-003233d60da4a2b69260642e57757bba48021ca1.tar.gz
bloat-003233d60da4a2b69260642e57757bba48021ca1.zip
Change config file lookup
- Look for both local and global config file - Directly generate the global config file with make install
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
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)
}