Exemple #1
0
func displayAllPullRequests(c *cli.Context) {
	prs, err := m.GetPullRequests(c.String("state"), c.String("sort"))
	if err != nil {
		gordon.Fatalf("Error getting pull requests %s", err)
	}

	var needFullPr, needComments bool

	if c.Bool("no-merge") {
		needFullPr = true
	}
	if c.Bool("lgtm") {
		needComments = true
	}

	if needFullPr || needComments {
		prs = m.GetFullPullRequests(prs, needFullPr, needComments)
	}

	prs, err = filters.FilterPullRequests(c, prs)
	if err != nil {
		gordon.Fatalf("Error filtering pull requests %s", err)
	}

	fmt.Printf("%c[2K\r", 27)
	gordon.DisplayPullRequests(c, prs, c.Bool("no-trunc"))
}
Exemple #2
0
func displayAllPullRequests(c *cli.Context, state string, showAll bool) {
	filter := filters.GetPullRequestFilter(c)
	prs, err := filter(m.GetPullRequestsThatICareAbout(showAll, state, c.String("sort")))
	if err != nil {
		gordon.WriteError("Error getting pull requests %s", err)
	}

	fmt.Printf("%c[2K\r", 27)
	gordon.DisplayPullRequests(c, prs, c.Bool("no-trunc"))
}