From c9769ee9661b24f8f0871b449539cbae92b20f4b Mon Sep 17 00:00:00 2001 From: Guohua Ouyang Date: Wed, 22 Jul 2015 09:01:19 +0800 Subject: [PATCH] etcdmain: Don't print flags when flag parse error At present it prints the whole usage and flags, which cause the exact error message is hidden two screens above. Fixes #3141 Signed-off-by: Guohua Ouyang --- etcdmain/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcdmain/config.go b/etcdmain/config.go index aacc45033..e1cd17f32 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -137,7 +137,6 @@ func NewConfig() *config { fs := cfg.FlagSet fs.Usage = func() { fmt.Println(usageline) - fmt.Println(flagsline) } // member @@ -225,6 +224,7 @@ func (cfg *config) Parse(arguments []string) error { switch perr { case nil: case flag.ErrHelp: + fmt.Println(flagsline) os.Exit(0) default: os.Exit(2)