You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2025/05/10 02:59:05 UTC
(answer) branch dev updated (aac1532b -> 4182d9f5)
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a change to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
from aac1532b chore(migrations): update migration version
new 757e8946 docs(command): remove redundant comments
new 4182d9f5 docs(command): unify style of usage statements
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
cmd/command.go | 40 +++++++++++++++-------------------------
1 file changed, 15 insertions(+), 25 deletions(-)
(answer) 01/02: docs(command): remove redundant comments
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
commit 757e89467a7b66b73b4b6ee16ab7967faeb5bd8b
Author: Shaobiao Lin <wh...@gmail.com>
AuthorDate: Tue May 6 19:06:56 2025 +0800
docs(command): remove redundant comments
The codes are self-documenting enough.
---
cmd/command.go | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/cmd/command.go b/cmd/command.go
index fe17713e..602a1229 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,7 +91,6 @@ To run answer, use:
- 'answer run' to launch application.`,
}
- // runCmd represents the run command
runCmd = &cobra.Command{
Use: "run",
Short: "Run the application",
@@ -105,7 +103,6 @@ To run answer, use:
},
}
- // initCmd represents the init command
initCmd = &cobra.Command{
Use: "init",
Short: "init answer application",
@@ -135,7 +132,6 @@ To run answer, use:
},
}
- // upgradeCmd represents the upgrade command
upgradeCmd = &cobra.Command{
Use: "upgrade",
Short: "upgrade Answer version",
@@ -157,7 +153,6 @@ To run answer, use:
},
}
- // dumpCmd represents the dump command
dumpCmd = &cobra.Command{
Use: "dump",
Short: "back up data",
@@ -179,7 +174,6 @@ To run answer, use:
},
}
- // checkCmd represents the check command
checkCmd = &cobra.Command{
Use: "check",
Short: "checking the required environment",
@@ -214,7 +208,6 @@ To run answer, use:
},
}
- // buildCmd used to build another answer with plugins
buildCmd = &cobra.Command{
Use: "build",
Short: "used to build answer with plugins",
@@ -235,7 +228,6 @@ 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",
@@ -249,7 +241,6 @@ To run answer, use:
},
}
- // configCmd set some config to default value
configCmd = &cobra.Command{
Use: "config",
Short: "set some config to default value",
@@ -286,7 +277,6 @@ To run answer, use:
},
}
- // i18nCmd used to merge i18n files
i18nCmd = &cobra.Command{
Use: "i18n",
Short: "overwrite i18n files",
(answer) 02/02: docs(command): unify style of usage statements
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
commit 4182d9f5061ca018d01c414acf9be67bb72aded3
Author: Shaobiao Lin <wh...@gmail.com>
AuthorDate: Tue May 6 19:59:15 2025 +0800
docs(command): unify style of usage statements
close #1330
---
cmd/command.go | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/cmd/command.go b/cmd/command.go
index 602a1229..7d779893 100644
--- a/cmd/command.go
+++ b/cmd/command.go
@@ -93,8 +93,8 @@ To run answer, use:
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,8 +105,8 @@ To run answer, use:
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)
@@ -134,8 +134,8 @@ To run answer, use:
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)
@@ -155,8 +155,8 @@ To run answer, use:
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)
@@ -176,7 +176,7 @@ To run answer, use:
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)
@@ -210,7 +210,7 @@ To run answer, use:
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"))
@@ -230,8 +230,8 @@ To run answer, use:
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()
@@ -243,8 +243,8 @@ To run answer, use:
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)
@@ -279,7 +279,7 @@ To run answer, use:
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 {