(f *cmdutil.Factory, telemetry ghtelemetry.InvocationRecorder)
| 25 | ) |
| 26 | |
| 27 | func NewCmdPR(f *cmdutil.Factory, telemetry ghtelemetry.InvocationRecorder) *cobra.Command { |
| 28 | cmd := &cobra.Command{ |
| 29 | Use: "pr <command>", |
| 30 | Short: "Manage pull requests", |
| 31 | Long: heredoc.Docf(` |
| 32 | Work with GitHub pull requests. |
| 33 | |
| 34 | To wait for a pull request on %[1]sgithub.com%[1]s to be reviewed, merged, or closed, use %[1]sgh event listen%[1]s instead of polling. |
| 35 | Changes made before the listener starts are not reported, so read the pull request once it is listening. |
| 36 | `, "`"), |
| 37 | Example: heredoc.Doc(` |
| 38 | $ gh pr checkout 353 |
| 39 | $ gh pr create --fill |
| 40 | $ gh pr view --web |
| 41 | `), |
| 42 | Annotations: map[string]string{ |
| 43 | "help:arguments": heredoc.Doc(` |
| 44 | A pull request can be supplied as argument in any of the following formats: |
| 45 | - by number, e.g. "123"; |
| 46 | - by URL, e.g. "https://github.com/OWNER/REPO/pull/123"; or |
| 47 | - by the name of its head branch, e.g. "patch-1" or "OWNER:patch-1". |
| 48 | `), |
| 49 | }, |
| 50 | GroupID: "core", |
| 51 | } |
| 52 | |
| 53 | cmdutil.EnableRepoOverride(cmd, f) |
| 54 | |
| 55 | cmdutil.AddGroup(cmd, "General commands", |
| 56 | cmdList.NewCmdList(f, nil), |
| 57 | cmdCreate.NewCmdCreate(f, telemetry, nil), |
| 58 | cmdStatus.NewCmdStatus(f, nil), |
| 59 | ) |
| 60 | |
| 61 | cmdutil.AddGroup(cmd, "Targeted commands", |
| 62 | cmdView.NewCmdView(f, nil), |
| 63 | cmdDiff.NewCmdDiff(f, nil), |
| 64 | cmdCheckout.NewCmdCheckout(f, nil), |
| 65 | cmdChecks.NewCmdChecks(f, nil), |
| 66 | cmdReview.NewCmdReview(f, nil), |
| 67 | cmdMerge.NewCmdMerge(f, nil), |
| 68 | cmdUpdateBranch.NewCmdUpdateBranch(f, nil), |
| 69 | cmdReady.NewCmdReady(f, nil), |
| 70 | cmdComment.NewCmdComment(f, telemetry, nil), |
| 71 | cmdClose.NewCmdClose(f, nil), |
| 72 | cmdReopen.NewCmdReopen(f, nil), |
| 73 | cmdRevert.NewCmdRevert(f, nil), |
| 74 | cmdEdit.NewCmdEdit(f, telemetry, nil), |
| 75 | cmdLock.NewCmdLock(f, cmd.Name(), nil), |
| 76 | cmdLock.NewCmdUnlock(f, cmd.Name(), nil), |
| 77 | ) |
| 78 | |
| 79 | return cmd |
| 80 | } |
nothing calls this directly
no test coverage detected