ectdctl: Handle the repeat error message when the unknown command error occurs

Avoid repeated printing of error messages.

Signed-off-by: SimFG <1142838399@qq.com>
This commit is contained in:
SimFG 2022-06-28 21:24:30 +08:00
parent 7a1cecd5fa
commit 66f15f8efb

View File

@ -16,6 +16,7 @@
package ctlv3
import (
"os"
"time"
"go.etcd.io/etcd/api/v3/version"
@ -114,7 +115,11 @@ func Start() error {
func MustStart() {
if err := Start(); err != nil {
cobrautl.ExitWithError(cobrautl.ExitError, err)
if rootCmd.SilenceErrors {
cobrautl.ExitWithError(cobrautl.ExitError, err)
} else {
os.Exit(cobrautl.ExitError)
}
}
}