cmd

package
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnumCmd = &cobra.Command{
	Use:   "enum",
	Short: "枚举生成器",
	Long:  `枚举生成器`,
	RunE: func(cmd *cobra.Command, args []string) error {
		code, err := enum.G.Generate()
		if err != nil {
			return err
		}

		fname := os.Getenv("GOFILE")

		genFile := fname[0:len(fname)-len(path.Ext(fname))] + "_generate.go"
		ioutil.WriteFile(genFile, code, 0644)
		return nil
	},
}

EnumCmd 枚举生成器

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "初始化",
	Long:  `初始化一个mcube项目`,
	RunE: func(cmd *cobra.Command, args []string) error {
		p, err := project.LoadConfigFromCLI()
		if err != nil {
			return err
		}

		err = p.Init()
		if err != nil {
			return err
		}
		return nil
	},
}

InitCmd 初始化系统

View Source
var RootCmd = &cobra.Command{
	Use:   "mcube",
	Short: "mcube 分布式服务构建工具",
	Long:  `mcube ...`,
	RunE: func(cmd *cobra.Command, args []string) error {
		return errors.New("no flags find")
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Directories

Path Synopsis
gencheck
templates
api
cmd
etc
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL