mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14173 from SimFG/ctl_err
ectdctl: Add the `SilenceErrors` config For the `cobra.Command`
This commit is contained in:
commit
07d620822f
@ -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