diff --git a/cmd/command.go b/cmd/command.go index fe17713e7..7d779893f 100644 --- a/cmd/command.go +++ b/cmd/command.go @@ -82,7 +82,6 @@ func init() { } var ( - // rootCmd represents the base command when called without any subcommands rootCmd = &cobra.Command{ Use: "answer", Short: "Answer is a minimalist open source Q&A community.", @@ -92,11 +91,10 @@ To run answer, use: - 'answer run' to launch application.`, } - // runCmd represents the run command runCmd = &cobra.Command{ Use: "run", - Short: "Run the application", - Long: `Run the application`, + Short: "Run Answer", + Long: `Start running Answer`, Run: func(_ *cobra.Command, _ []string) { cli.FormatAllPath(dataDirPath) fmt.Println("config file path: ", cli.GetConfigFilePath()) @@ -105,11 +103,10 @@ To run answer, use: }, } - // initCmd represents the init command initCmd = &cobra.Command{ Use: "init", - Short: "init answer application", - Long: `init answer application`, + Short: "Initialize Answer", + Long: `Initialize Answer with specified configuration`, Run: func(_ *cobra.Command, _ []string) { // check config file and database. if config file exists and database is already created, init done cli.InstallAllInitialEnvironment(dataDirPath) @@ -135,11 +132,10 @@ To run answer, use: }, } - // upgradeCmd represents the upgrade command upgradeCmd = &cobra.Command{ Use: "upgrade", - Short: "upgrade Answer version", - Long: `upgrade Answer version`, + Short: "Upgrade Answer", + Long: `Upgrade Answer to the latest version`, Run: func(_ *cobra.Command, _ []string) { log.SetLogger(log.NewStdLogger(os.Stdout)) cli.FormatAllPath(dataDirPath) @@ -157,11 +153,10 @@ To run answer, use: }, } - // dumpCmd represents the dump command dumpCmd = &cobra.Command{ Use: "dump", - Short: "back up data", - Long: `back up data`, + Short: "Back up data", + Long: `Back up database into an SQL file`, Run: func(_ *cobra.Command, _ []string) { fmt.Println("Answer is backing up data") cli.FormatAllPath(dataDirPath) @@ -179,10 +174,9 @@ To run answer, use: }, } - // checkCmd represents the check command checkCmd = &cobra.Command{ Use: "check", - Short: "checking the required environment", + Short: "Check the required environment", Long: `Check if the current environment meets the startup requirements`, Run: func(_ *cobra.Command, _ []string) { cli.FormatAllPath(dataDirPath) @@ -214,10 +208,9 @@ To run answer, use: }, } - // buildCmd used to build another answer with plugins buildCmd = &cobra.Command{ Use: "build", - Short: "used to build answer with plugins", + Short: "Build Answer with plugins", Long: `Build a new Answer with plugins that you need`, Run: func(_ *cobra.Command, _ []string) { fmt.Printf("try to build a new answer with plugins:\n%s\n", strings.Join(buildWithPlugins, "\n")) @@ -235,11 +228,10 @@ To run answer, use: }, } - // pluginCmd prints all plugins packed in the binary pluginCmd = &cobra.Command{ Use: "plugin", - Short: "prints all plugins packed in the binary", - Long: `prints all plugins packed in the binary`, + Short: "Print all plugins packed in the binary", + Long: `Print all plugins packed in the binary`, Run: func(_ *cobra.Command, _ []string) { _ = plugin.CallBase(func(base plugin.Base) error { info := base.Info() @@ -249,11 +241,10 @@ To run answer, use: }, } - // configCmd set some config to default value configCmd = &cobra.Command{ Use: "config", - Short: "set some config to default value", - Long: `set some config to default value`, + Short: "Set some config to default value", + Long: `Set some config to default value`, Run: func(_ *cobra.Command, _ []string) { cli.FormatAllPath(dataDirPath) @@ -286,10 +277,9 @@ To run answer, use: }, } - // i18nCmd used to merge i18n files i18nCmd = &cobra.Command{ Use: "i18n", - Short: "overwrite i18n files", + Short: "Overwrite i18n files", Long: `Merge i18n files from plugins to original i18n files. It will overwrite the original i18n files`, Run: func(_ *cobra.Command, _ []string) { if err := cli.ReplaceI18nFilesLocal(i18nTargetPath); err != nil {