mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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:
parent
7a1cecd5fa
commit
66f15f8efb
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user