Skip to content

Commit

Permalink
Add option to show pull requests again
Browse files Browse the repository at this point in the history
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: mislav#1303
Related: vermiculus/magithub#44
  • Loading branch information
vermiculus committed Feb 15, 2017
1 parent 3d3facb commit 6a4212b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
`,
}

Expand All @@ -156,6 +159,7 @@ With no arguments, show a list of open issues.
flagIssueCopy,
flagIssueBrowse,
flagIssueSortAscending bool
flagIssueShowPulls bool

flagIssueMilestone uint64

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 6a4212b

Please sign in to comment.