cmd

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 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
		}

		if len(code) == 0 {
			return nil
		}

		fname := os.Getenv("GOFILE")
		genFile := fname[0:len(fname)-len(path.Ext(fname))] + "_enum_generate.go"

		return ioutil.WriteFile(genFile, code, 0644)
	},
}

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