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 <gouyang@redhat.com>
release-2.2
Guohua Ouyang 2015-07-22 09:01:19 +08:00
parent 40681bdf03
commit c9769ee966
1 changed files with 1 additions and 1 deletions

View File

@ -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)