Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

style: root add command by command array

LinkinStar258985ee2bc8
diff --git a/cmd/answer/command.go b/cmd/answer/command.go
index 408f9fc4..fd9d8f3b 100644
--- a/cmd/answer/command.go
+++ b/cmd/answer/command.go
@@ -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 (