From 6a02ad3f1b83cab385d36cdc0e59ef436d38cd1e Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 22 Jun 2020 15:09:21 -0400 Subject: [PATCH] Add repoflag to pr commands --- command/pr.go | 7 +++++++ command/pr_diff.go | 1 + command/pr_review.go | 1 + 3 files changed, 9 insertions(+) diff --git a/command/pr.go b/command/pr.go index 18150d4eb..0aa7d25b1 100644 --- a/command/pr.go +++ b/command/pr.go @@ -27,16 +27,22 @@ func init() { prCmd.AddCommand(prCheckoutCmd) prCmd.AddCommand(prCreateCmd) prCmd.AddCommand(prStatusCmd) + includeRepoFlag(prStatusCmd) prCmd.AddCommand(prCloseCmd) + includeRepoFlag(prCloseCmd) prCmd.AddCommand(prReopenCmd) + includeRepoFlag(prReopenCmd) prCmd.AddCommand(prMergeCmd) + includeRepoFlag(prMergeCmd) prMergeCmd.Flags().BoolP("delete-branch", "d", true, "Delete the local and remote branch after merge") prMergeCmd.Flags().BoolP("merge", "m", false, "Merge the commits with the base branch") prMergeCmd.Flags().BoolP("rebase", "r", false, "Rebase the commits onto the base branch") prMergeCmd.Flags().BoolP("squash", "s", false, "Squash the commits into one commit and merge it into the base branch") prCmd.AddCommand(prReadyCmd) + includeRepoFlag(prReadyCmd) prCmd.AddCommand(prListCmd) + includeRepoFlag(prListCmd) prListCmd.Flags().IntP("limit", "L", 30, "Maximum number of items to fetch") prListCmd.Flags().StringP("state", "s", "open", "Filter by state: {open|closed|merged|all}") prListCmd.Flags().StringP("base", "B", "", "Filter by base branch") @@ -44,6 +50,7 @@ func init() { prListCmd.Flags().StringP("assignee", "a", "", "Filter by assignee") prCmd.AddCommand(prViewCmd) + includeRepoFlag(prViewCmd) prViewCmd.Flags().BoolP("web", "w", false, "Open a pull request in the browser") } diff --git a/command/pr_diff.go b/command/pr_diff.go index ae50a2618..0bc9c8613 100644 --- a/command/pr_diff.go +++ b/command/pr_diff.go @@ -19,6 +19,7 @@ func init() { prDiffCmd.Flags().StringP("color", "c", "auto", "Whether or not to output color: {always|never|auto}") prCmd.AddCommand(prDiffCmd) + includeRepoFlag(prDiffCmd) } func prDiff(cmd *cobra.Command, args []string) error { diff --git a/command/pr_review.go b/command/pr_review.go index 08efc638d..77723ab44 100644 --- a/command/pr_review.go +++ b/command/pr_review.go @@ -15,6 +15,7 @@ import ( func init() { prCmd.AddCommand(prReviewCmd) + includeRepoFlag(prCmd) prReviewCmd.Flags().BoolP("approve", "a", false, "Approve pull request") prReviewCmd.Flags().BoolP("request-changes", "r", false, "Request changes on a pull request")