From 4eeaa9f705a6732d0c0b31956b627eaaff4387a8 Mon Sep 17 00:00:00 2001 From: Igor Shishkin Date: Tue, 5 Nov 2019 00:39:34 +0300 Subject: [PATCH] Fix --version Signed-off-by: Igor Shishkin --- config.go | 5 +++++ main.go | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 179bed2..3924bd4 100644 --- a/config.go +++ b/config.go @@ -33,6 +33,11 @@ func newConfig() *config { set := flag.NewFlagSet(flag.Flag{}) set.ParseStruct(&c, os.Args...) + if c.Version == true { + printVersion() + os.Exit(0) + } + if c.DbPath == "" { set.Help(true) os.Exit(1) diff --git a/main.go b/main.go index fb4632b..5ae5ef1 100644 --- a/main.go +++ b/main.go @@ -37,11 +37,6 @@ var ( func main() { cfg := newConfig() - if cfg.Version == true { - printVersion() - return - } - if cfg.Complete == true { completeArgs(flag.Arg(1)) return