diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-05-03 14:52:56 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-05-03 14:52:56 +0200 |
commit | 416be8872c0066a84a3e03622bb3dbb7c5544eea (patch) | |
tree | de67afddf63c9ec8414f247863526e943ec64299 | |
parent | e4c683ece5044cee42b670bf04031429e426eddb (diff) | |
download | feed2imap-go-416be8872c0066a84a3e03622bb3dbb7c5544eea.tar.gz feed2imap-go-416be8872c0066a84a3e03622bb3dbb7c5544eea.tar.bz2 feed2imap-go-416be8872c0066a84a3e03622bb3dbb7c5544eea.zip |
--version flag
-rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 { |