1
0

cmd.go 573 B

1234567891011121314151617181920212223
  1. package cmd
  2. import (
  3. "github.com/spf13/cobra"
  4. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/compare/testdata"
  5. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/util/console"
  6. )
  7. var rootCmd = &cobra.Command{
  8. Use: "compare",
  9. Short: "Compare the goctl commands generated results between urfave and cobra",
  10. Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
  11. Run: func(cmd *cobra.Command, args []string) {
  12. dir := args[0]
  13. testdata.MustRun(dir)
  14. },
  15. }
  16. func Execute() {
  17. if err := rootCmd.Execute(); err != nil {
  18. console.Error("%+v", err)
  19. }
  20. }