aboutsummaryrefslogtreecommitdiff
path: root/cmd/feed2imap-go.go
blob: 20e6ed7a1cb7d20972d35cbfb43dec4da32e05d5 (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
package main

import (
	"flag"
	"github.com/Necoro/feed2imap-go/internal/config"
	"log"
	"os"
)

var cfgFile = flag.String("f", "config.yml", "configuration file")

func run() error {
	log.Print("Starting up...")
	flag.Parse()

	log.Printf("Reading configuration file '%s'", *cfgFile)
	if _, err := config.Load(*cfgFile); err != nil {
		return err
	}

	return nil
}

func main() {
	if err := run(); err != nil {
		log.SetOutput(os.Stderr)
		log.Print("Error: ", err)
		os.Exit(1)
	}
}