blob: bbea985fa3a596a3f69d9b75ad2e52bc78ba3f75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package main
import (
"flag"
"os"
"github.com/Necoro/feed2imap-go/internal/config"
"github.com/Necoro/feed2imap-go/internal/log"
"github.com/Necoro/feed2imap-go/internal/parse"
)
var cfgFile = flag.String("f", "config.yml", "configuration file")
var verbose = flag.Bool("v", false, "enable verbose output")
func run() error {
flag.Parse()
log.SetDebug(*verbose)
log.Print("Starting up...")
log.Printf("Reading configuration file '%s'", *cfgFile)
cfg, err := config.Load(*cfgFile)
if err != nil {
return err
}
parse.Parse(cfg.Feeds)
return nil
}
func main() {
if err := run(); err != nil {
log.Error(err)
os.Exit(1)
}
}
|