Skip to content

Commit

Permalink
revert cobra to an older version
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxinyu committed Dec 15, 2021
1 parent cb1a445 commit 0bd569c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 286 deletions.
5 changes: 1 addition & 4 deletions cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ func newCliCommand() *cobra.Command {
Use: "cli",
Args: cobra.NoArgs,
Short: "Manage replication task and TiCDC cluster",
//CompletionOptions: cobra.CompletionOptions{
// DisableDefaultCmd: true,
//},
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
initCmd(cmd, &logutil.Config{Level: cliLogLevel})

Expand Down Expand Up @@ -268,7 +265,7 @@ func loop() {
command.SetOut(os.Stdout)
command.SetErr(os.Stderr)
if err = command.Execute(); err != nil {
command.PrintErrln(err)
command.PrintErr(err.Error() + "\n")
}
}
}
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ var rootCmd = &cobra.Command{
func Execute() {
// Outputs cmd.Print to stdout.
rootCmd.SetOut(os.Stdout)
rootCmd.SetErr(os.Stderr)
if err := rootCmd.Execute(); err != nil {
rootCmd.Println(err)
rootCmd.PrintErr(err.Error() + "\n")
os.Exit(1)
}
}
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ require (
github.com/fatih/color v1.10.0
github.com/go-sql-driver/mysql v1.5.0
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.3.4
github.com/golang/snappy v0.0.2 // indirect
github.com/google/btree v1.0.0
github.com/google/go-cmp v0.5.5
github.com/google/uuid v1.1.2
github.com/google/go-cmp v0.5.4
github.com/google/uuid v1.1.1
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.14.3 // indirect
github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc
github.com/jarcoal/httpmock v1.0.5
github.com/jmoiron/sqlx v1.2.0
Expand All @@ -45,28 +46,28 @@ require (
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible
github.com/prometheus/client_golang v1.5.1
github.com/r3labs/diff v1.1.0
github.com/spf13/cobra v1.2.1
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.6.1
github.com/tikv/pd v1.1.0-beta.0.20210527030735-a544782ee076
github.com/tinylib/msgp v1.1.0
github.com/uber-go/atomic v1.4.0
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c
go.etcd.io/bbolt v1.3.4 // indirect
go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b
go.uber.org/zap v1.17.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/exp v0.0.0-20200513190911-00229845015e // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20210323141857-08027d57d8cf
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/text v0.3.5
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/grpc v1.38.0
google.golang.org/grpc v1.27.1
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
upper.io/db.v3 v3.7.1+incompatible
)

// Fix CVE-2020-26160.
replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt v3.2.1+incompatible

replace google.golang.org/grpc => google.golang.org/grpc v1.29.1

0 comments on commit 0bd569c

Please sign in to comment.