move to init

This commit is contained in:
Corey Johnson 2019-11-06 10:01:16 -08:00
parent 875352a03c
commit b50898f05b

View file

@ -10,11 +10,20 @@ import (
)
func init() {
RootCmd.AddCommand(issueCmd)
var issueCmd = &cobra.Command{
Use: "issue",
Short: "Work with GitHub issues",
Long: `This command allows you to work with issues.`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("%+v is not a valid issue command", args)
},
}
issueCmd.AddCommand(
&cobra.Command{
Use: "list",
Short: "List issues",
Use: "status",
Short: "Display issue status",
RunE: issueList,
},
&cobra.Command{
@ -24,16 +33,8 @@ func init() {
RunE: issueView,
},
)
}
var issueCmd = &cobra.Command{
Use: "issue",
Short: "Work with GitHub issues",
Long: `This command allows you to work with issues.`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("%+v is not a valid issue command", args)
},
RootCmd.AddCommand(issueCmd)
}
func issueList(cmd *cobra.Command, args []string) error {