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
parent
40681bdf03
commit
c9769ee966
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue