From 4edb8650e50ea06402bd5e8544a35cca6bc82c7e Mon Sep 17 00:00:00 2001 From: "xueyun.liu" Date: Tue, 9 May 2017 15:49:59 +0800 Subject: [PATCH] fix version option in cmd --- cmd/cmd.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index 26401875..58d55880 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -413,6 +413,7 @@ func (c *cmd) Init(opts ...Option) error { } c.app.Name = c.opts.Name c.app.Version = c.opts.Version + c.app.HideVersion = len(c.opts.Version) == 0 c.app.Usage = c.opts.Description c.app.RunAndExitOnError() return nil