From 416be8872c0066a84a3e03622bb3dbb7c5544eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 3 May 2020 14:52:56 +0200 Subject: --version flag --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index ec2e91f..074c14b 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "github.com/Necoro/feed2imap-go/pkg/log" ) +var printVersion = flag.Bool("version", false, "print version and exit") var cfgFile = flag.String("f", "config.yml", "configuration file") var cacheFile = flag.String("c", "feed.cache", "cache file") var verbose = flag.Bool("v", false, "enable verbose output") @@ -49,6 +50,11 @@ func processFeed(feed *feed.Feed, client *imap.Client, dryRun bool) { func run() error { flag.Parse() + if *printVersion { + println("Feed2Imap-Go, version " + config.Version()) + return nil + } + if *debug { log.SetDebug() } else if *verbose { -- cgit v1.2.3