style: root add command by command array

This commit is contained in:
LinkinStar 2022-10-26 18:09:39 +08:00
parent 82ab33ee91
commit 258985ee2b
1 changed files with 3 additions and 5 deletions

View File

@ -27,11 +27,9 @@ func init() {
dumpCmd.Flags().StringVarP(&dumpDataPath, "path", "p", "./", "dump data path, eg: -p ./dump/data/")
rootCmd.AddCommand(initCmd)
rootCmd.AddCommand(checkCmd)
rootCmd.AddCommand(runCmd)
rootCmd.AddCommand(dumpCmd)
rootCmd.AddCommand(upgradeCmd)
for _, cmd := range []*cobra.Command{initCmd, checkCmd, runCmd, dumpCmd, upgradeCmd} {
rootCmd.AddCommand(cmd)
}
}
var (