Skip to content

Commit

Permalink
refactor(cmd.go): export all cdc subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
wlwilliamx committed Oct 22, 2024
1 parent 8e2322b commit 382dad7
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 382dad7

Please sign in to comment.