diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-17 21:53:15 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-17 21:53:15 +0200 |
commit | b01a98682ad7881c997fe5fc0770ef984013111f (patch) | |
tree | 9b52a17c17390d2738ec862de3799e8ccd9348c7 /cmd | |
parent | c96ca310a019a892a717373677ded36dc0b9e2b3 (diff) | |
download | feed2imap-go-b01a98682ad7881c997fe5fc0770ef984013111f.tar.gz feed2imap-go-b01a98682ad7881c997fe5fc0770ef984013111f.tar.bz2 feed2imap-go-b01a98682ad7881c997fe5fc0770ef984013111f.zip |
Split up main.go
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/feed2imap-go.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/feed2imap-go.go b/cmd/feed2imap-go.go new file mode 100644 index 0000000..20e6ed7 --- /dev/null +++ b/cmd/feed2imap-go.go @@ -0,0 +1,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) + } +} |