MCPcopy Index your code
hub / github.com/cli/cli / NewCmdPR

Function NewCmdPR

pkg/cmd/pr/pr.go:26–74  ·  view source on GitHub ↗
(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

EnableRepoOverrideFunction · 0.92
AddGroupFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected