ectdctl: Handle the repeat error message when the unknown command error occurs
Avoid repeated printing of error messages.
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 {
+ if rootCmd.SilenceErrors {
cobrautl.ExitWithError(cobrautl.ExitError, err)
+ } else {
+ os.Exit(cobrautl.ExitError)
+ }
}
}
