Skip to content

Commit

Permalink
cmd(ticdc): Export All cdc Subcommands (#11677)
Browse files Browse the repository at this point in the history
close #11676
  • Loading branch information
wlwilliamx authored Oct 23, 2024
1 parent 60e2bfa commit dd2d54a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,23 @@ func NewCmd() *cobra.Command {
}
}

// AddTiCDCCommandTo add all cdc subcommands to `cmd`.
// Exported for ticdc new arch.
func AddTiCDCCommandTo(cmd *cobra.Command) {
cmd.AddCommand(server.NewCmdServer())
cmd.AddCommand(cli.NewCmdCli())
cmd.AddCommand(version.NewCmdVersion())
cmd.AddCommand(redo.NewCmdRedo())
}

// Run runs the root command.
func Run() {
cmd := NewCmd()

cmd.SetOut(os.Stdout)
cmd.SetErr(os.Stderr)

cmd.AddCommand(server.NewCmdServer())
cmd.AddCommand(cli.NewCmdCli())
cmd.AddCommand(version.NewCmdVersion())
cmd.AddCommand(redo.NewCmdRedo())
AddTiCDCCommandTo(cmd)

if err := cmd.Execute(); err != nil {
cmd.PrintErrln(err)
Expand Down

0 comments on commit dd2d54a

Please sign in to comment.