diff options
author | r <r@freesoftwareextremist.com> | 2022-01-02 10:52:15 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2022-01-02 10:55:26 +0000 |
commit | 003233d60da4a2b69260642e57757bba48021ca1 (patch) | |
tree | 2d429cdfb05c4473523538aef692f268020b0d40 /main.go | |
parent | 21ef7a66106958bd61534e5d0603b447e6fe306d (diff) | |
download | bloat-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.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) } |