aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 498d22c4a40a5bfbbd9100d77c957350709db1e5 (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
package main

import (
	"flag"
	"log"
	"os"

	"github.com/Necoro/feed2imap-go/internal/config"
)

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)
	}
}