From b50898f05b97d36292281172035ef9ea575522db Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 6 Nov 2019 10:01:16 -0800 Subject: [PATCH] move to init --- command/issue.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/command/issue.go b/command/issue.go index e64d8d806..17dc9507e 100644 --- a/command/issue.go +++ b/command/issue.go @@ -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 {