From 2ebc5ce514780abcb8129b330a5357329f8819b0 Mon Sep 17 00:00:00 2001 From: ShubhankarKG Date: Wed, 10 Jun 2020 18:40:12 +0530 Subject: [PATCH] Added examples and custom error message for space separated issues --- command/issue.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/command/issue.go b/command/issue.go index 305b6f832..371440066 100644 --- a/command/issue.go +++ b/command/issue.go @@ -65,7 +65,17 @@ var issueCreateCmd = &cobra.Command{ var issueListCmd = &cobra.Command{ Use: "list", Short: "List and filter issues in this repository", - RunE: issueList, + Args: func(cmd *cobra.Command, args []string) error { + if len(args) > 0 { + return fmt.Errorf("unknown command %q for %q. Please include whitespace separated issue names within quotes if necessary", args[0], cmd.CommandPath()) + } + return nil + }, + Example: ` + gh issue list + gh issue list -l "help wanted" + `, + RunE: issueList, } var issueStatusCmd = &cobra.Command{ Use: "status",