cmd

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstallCmd = &cobra.Command{
	Use:   "install",
	Short: "Install this tool to git-core as git-cz",
	Run: func(cmd *cobra.Command, args []string) {
		appFilePath, _ := exec.LookPath(os.Args[0])
		if path, err := git.InstallSubCmd(appFilePath, "cz"); err != nil {
			fmt.Printf("Install commitizen failed, err=%v\n", err)
		} else {
			fmt.Printf("Install commitizen to %s\n", path)
		}
	},
}
View Source
var InstallHookCmd = &cobra.Command{
	Use:   "install-hook",
	Short: "Install this tool to ./git/hooks/prepare-commit-msg",
	Run: func(cmd *cobra.Command, args []string) {
		if err := git.InstallHookCmd(); err != nil {
			fmt.Printf("Install commitizen as hook failed, err=%v\n", err)
		} else {
			fmt.Printf("Successful install commitizen as git hook in .git/hoooks/prepare-commit-msg\n")
		}
	},
}
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print version information and quit",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("Commitizen-go version 1.0.0, build revision %s\n", revision)
	},
}

Functions

func Execute

func Execute() error

func RootCmd

func RootCmd(command *cobra.Command, args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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