From 6a4212b514d11598f9c1e7370fbbb2a8b44f3f6b Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 15 Feb 2017 00:32:52 -0600 Subject: [PATCH] Add option to show pull requests again This change adds a long-form flag `--show-pulls` to `hub issue` that directs hub to include pull requests in the issue listing. The default value is false; the default behavior does not change. Temporary fix until a better abstraction for pull requests can be designed. Related: #1303 Related: vermiculus/magithub#44 --- commands/issue.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/issue.go b/commands/issue.go index ad3512e24..6e0db95f9 100644 --- a/commands/issue.go +++ b/commands/issue.go @@ -130,6 +130,9 @@ With no arguments, show a list of open issues. -^ --sort-ascending Sort by ascending dates instead of descending. + + --show-pulls + Show pull requests as well. `, } @@ -156,6 +159,7 @@ With no arguments, show a list of open issues. flagIssueCopy, flagIssueBrowse, flagIssueSortAscending bool + flagIssueShowPulls bool flagIssueMilestone uint64 @@ -183,6 +187,7 @@ func init() { cmdIssue.Flag.StringVarP(&flagIssueSince, "since", "d", "", "DATE") cmdIssue.Flag.StringVarP(&flagIssueSort, "sort", "o", "created", "SORT_KEY") cmdIssue.Flag.BoolVarP(&flagIssueSortAscending, "sort-ascending", "^", false, "SORT_KEY") + cmdIssue.Flag.BoolVarP(&flagIssueShowPulls, "show-pulls", "", false, "SHOW_PULLS") cmdIssue.Use(cmdCreateIssue) CmdRunner.Use(cmdIssue) @@ -240,7 +245,7 @@ func listIssues(cmd *Command, args *Args) { colorize := ui.IsTerminal(os.Stdout) for _, issue := range issues { - if issue.PullRequest != nil { + if !flagIssueShowPulls && issue.PullRequest != nil { continue }