diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 01:12:25 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 01:12:25 +0200 |
commit | 8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e (patch) | |
tree | e5322144c7aa324a01440f38f38a3d0d8ed8315a /main.go | |
parent | 02c4c6e73cc97c7aefd70ebf7be9e7e6479b2f01 (diff) | |
download | feed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.tar.gz feed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.tar.bz2 feed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.zip |
Fetching and parsing the feeds
Diffstat (limited to '')
-rw-r--r-- | main.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -6,6 +6,8 @@ import ( "os" "github.com/Necoro/feed2imap-go/internal/config" + "github.com/Necoro/feed2imap-go/internal/parse" + "github.com/Necoro/feed2imap-go/internal/util" ) var cfgFile = flag.String("f", "config.yml", "configuration file") @@ -15,17 +17,19 @@ func run() error { flag.Parse() log.Printf("Reading configuration file '%s'", *cfgFile) - if _, err := config.Load(*cfgFile); err != nil { + cfg, err := config.Load(*cfgFile) + if err != nil { return err } + parse.Parse(cfg.Feeds) + return nil } func main() { if err := run(); err != nil { - log.SetOutput(os.Stderr) - log.Print("Error: ", err) + util.Error(err) os.Exit(1) } } |