NewDebugCommand return a debug subcommand.
()
| 35 | |
| 36 | // NewDebugCommand return a debug subcommand. |
| 37 | func NewDebugCommand() *cobra.Command { |
| 38 | meta := &cobra.Command{ |
| 39 | Use: "debug <subcommand>", |
| 40 | Short: "commands to check/debug backup data", |
| 41 | SilenceUsage: false, |
| 42 | PersistentPreRunE: func(c *cobra.Command, args []string) error { |
| 43 | if err := Init(c); err != nil { |
| 44 | return errors.Trace(err) |
| 45 | } |
| 46 | build.LogInfo(build.BR) |
| 47 | tidblogutil.LogEnvVariables() |
| 48 | task.LogArguments(c) |
| 49 | return nil |
| 50 | }, |
| 51 | // To be compatible with older BR. |
| 52 | Aliases: []string{"validate"}, |
| 53 | } |
| 54 | meta.AddCommand(newCheckSumCommand()) |
| 55 | meta.AddCommand(newBackupMetaCommand()) |
| 56 | meta.AddCommand(decodeBackupMetaCommand()) |
| 57 | meta.AddCommand(encodeBackupMetaCommand()) |
| 58 | meta.AddCommand(setPDConfigCommand()) |
| 59 | meta.AddCommand(searchStreamBackupCommand()) |
| 60 | meta.Hidden = true |
| 61 | |
| 62 | return meta |
| 63 | } |
| 64 | |
| 65 | func newCheckSumCommand() *cobra.Command { |
| 66 | command := &cobra.Command{ |
no test coverage detected