From bfdef59377cdcbee135d4002e895cbe9400b6520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 27 Nov 2019 16:49:24 +0100 Subject: [PATCH] :nail_care: consistent sub-command initialization style --- command/issue.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/command/issue.go b/command/issue.go index 0c022939f..7a5a1b086 100644 --- a/command/issue.go +++ b/command/issue.go @@ -14,20 +14,9 @@ import ( func init() { RootCmd.AddCommand(issueCmd) - issueCmd.AddCommand( - &cobra.Command{ - Use: "status", - Short: "Show status of relevant issues", - RunE: issueStatus, - }, - &cobra.Command{ - Use: "view ", - Args: cobra.MinimumNArgs(1), - Short: "View an issue in the browser", - RunE: issueView, - }, - ) issueCmd.AddCommand(issueCreateCmd) + issueCmd.AddCommand(issueStatusCmd) + issueCmd.AddCommand(issueViewCmd) issueCreateCmd.Flags().StringP("title", "t", "", "Supply a title. Will prompt for one otherwise.") issueCreateCmd.Flags().StringP("body", "b", "", @@ -56,6 +45,17 @@ var issueCreateCmd = &cobra.Command{ Short: "Create a new issue", RunE: issueCreate, } +var issueStatusCmd = &cobra.Command{ + Use: "status", + Short: "Show status of relevant issues", + RunE: issueStatus, +} +var issueViewCmd = &cobra.Command{ + Use: "view ", + Args: cobra.MinimumNArgs(1), + Short: "View an issue in the browser", + RunE: issueView, +} func issueList(cmd *cobra.Command, args []string) error { ctx := contextForCommand(cmd)