Skip to content

Commit

Permalink
Fix --version
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <[email protected]>
  • Loading branch information
teran committed Nov 4, 2019
1 parent d156ec3 commit 4eeaa9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ var (
func main() {
cfg := newConfig()

if cfg.Version == true {
printVersion()
return
}

if cfg.Complete == true {
completeArgs(flag.Arg(1))
return
Expand Down

0 comments on commit 4eeaa9f

Please sign in to comment.