aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..498d22c
--- /dev/null
+++ b/main.go
@@ -0,0 +1,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)
+ }
+}