Skip to content

Commit 2ebc5ce

Browse files
committed
Added examples and custom error message for space separated issues
1 parent 217998a commit 2ebc5ce

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

command/issue.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,17 @@ var issueCreateCmd = &cobra.Command{
6565
var issueListCmd = &cobra.Command{
6666
Use: "list",
6767
Short: "List and filter issues in this repository",
68-
RunE: issueList,
68+
Args: func(cmd *cobra.Command, args []string) error {
69+
if len(args) > 0 {
70+
return fmt.Errorf("unknown command %q for %q. Please include whitespace separated issue names within quotes if necessary", args[0], cmd.CommandPath())
71+
}
72+
return nil
73+
},
74+
Example: `
75+
gh issue list
76+
gh issue list -l "help wanted"
77+
`,
78+
RunE: issueList,
6979
}
7080
var issueStatusCmd = &cobra.Command{
7181
Use: "status",

0 commit comments

Comments
 (0)