feat: Replace cli to cobra (#1855)

* Replace cli

* Replace cli

* Replace cli

* Format code

* Add compare case

* Add compare case

* Add compare case

* Support go style flag

* Support go style flag

* Add test case
This commit is contained in:
anqiansong
2022-05-07 15:40:11 +08:00
committed by GitHub
parent 51472004a3
commit 5383e29ce6
61 changed files with 1858 additions and 1590 deletions

View File

@@ -0,0 +1,23 @@
package cmd
import (
"github.com/spf13/cobra"
"github.com/zeromicro/go-zero/tools/goctl/compare/testdata"
"github.com/zeromicro/go-zero/tools/goctl/util/console"
)
var rootCmd = &cobra.Command{
Use: "compare",
Short: "Compare the goctl commands generated results between urfave and cobra",
Args: cobra.ExactValidArgs(1),
Run: func(cmd *cobra.Command, args []string) {
dir := args[0]
testdata.MustRun(dir)
},
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
console.Error("%+v", err)
}
}