MCPcopy Create free account
hub / github.com/cli/cli / NewCmdPR

Function NewCmdPR

pkg/cmd/pr/pr.go:27–75  ·  view source on GitHub ↗
(f *cmdutil.Factory, telemetry ghtelemetry.CommandRecorder)

Source from the content-addressed store, hash-verified

25)
26
27func NewCmdPR(f *cmdutil.Factory, telemetry ghtelemetry.CommandRecorder) *cobra.Command {
28 cmd := &cobra.Command{
29 Use: "pr <command>",
30 Short: "Manage pull requests",
31 Long: "Work with GitHub pull requests.",
32 Example: heredoc.Doc(`
33 $ gh pr checkout 353
34 $ gh pr create --fill
35 $ gh pr view --web
36 `),
37 Annotations: map[string]string{
38 "help:arguments": heredoc.Doc(`
39 A pull request can be supplied as argument in any of the following formats:
40 - by number, e.g. "123";
41 - by URL, e.g. "https://github.com/OWNER/REPO/pull/123"; or
42 - by the name of its head branch, e.g. "patch-1" or "OWNER:patch-1".
43 `),
44 },
45 GroupID: "core",
46 }
47
48 cmdutil.EnableRepoOverride(cmd, f)
49
50 cmdutil.AddGroup(cmd, "General commands",
51 cmdList.NewCmdList(f, nil),
52 cmdCreate.NewCmdCreate(f, telemetry, nil),
53 cmdStatus.NewCmdStatus(f, nil),
54 )
55
56 cmdutil.AddGroup(cmd, "Targeted commands",
57 cmdView.NewCmdView(f, nil),
58 cmdDiff.NewCmdDiff(f, nil),
59 cmdCheckout.NewCmdCheckout(f, nil),
60 cmdChecks.NewCmdChecks(f, nil),
61 cmdReview.NewCmdReview(f, nil),
62 cmdMerge.NewCmdMerge(f, nil),
63 cmdUpdateBranch.NewCmdUpdateBranch(f, nil),
64 cmdReady.NewCmdReady(f, nil),
65 cmdComment.NewCmdComment(f, telemetry, nil),
66 cmdClose.NewCmdClose(f, nil),
67 cmdReopen.NewCmdReopen(f, nil),
68 cmdRevert.NewCmdRevert(f, nil),
69 cmdEdit.NewCmdEdit(f, telemetry, nil),
70 cmdLock.NewCmdLock(f, cmd.Name(), nil),
71 cmdLock.NewCmdUnlock(f, cmd.Name(), nil),
72 )
73
74 return cmd
75}

Callers

nothing calls this directly

Calls 3

EnableRepoOverrideFunction · 0.92
AddGroupFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected