aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 01:12:25 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 01:12:25 +0200
commit8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e (patch)
treee5322144c7aa324a01440f38f38a3d0d8ed8315a /main.go
parent02c4c6e73cc97c7aefd70ebf7be9e7e6479b2f01 (diff)
downloadfeed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.tar.gz
feed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.tar.bz2
feed2imap-go-8984dc3ca7dc72a1cf563ccc6fc85fbeb231117e.zip
Fetching and parsing the feeds
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.go b/main.go
index 498d22c..c155a1b 100644
--- a/main.go
+++ b/main.go
@@ -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)
}
}