MCPcopy
hub / github.com/cli/cli / NewCmdReopen

Function NewCmdReopen

pkg/cmd/pr/reopen/reopen.go:25–52  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*ReopenOptions) error)

Source from the content-addressed store, hash-verified

23}
24
25func NewCmdReopen(f *cmdutil.Factory, runF func(*ReopenOptions) error) *cobra.Command {
26 opts := &ReopenOptions{
27 IO: f.IOStreams,
28 HttpClient: f.HttpClient,
29 }
30
31 cmd := &cobra.Command{
32 Use: "reopen {<number> | <url> | <branch>}",
33 Short: "Reopen a pull request",
34 Args: cobra.ExactArgs(1),
35 RunE: func(cmd *cobra.Command, args []string) error {
36 opts.Finder = shared.NewFinder(f)
37
38 if len(args) > 0 {
39 opts.SelectorArg = args[0]
40 }
41
42 if runF != nil {
43 return runF(opts)
44 }
45 return reopenRun(opts)
46 },
47 }
48
49 cmd.Flags().StringVarP(&opts.Comment, "comment", "c", "", "Add a reopening comment")
50
51 return cmd
52}
53
54func reopenRun(opts *ReopenOptions) error {
55 cs := opts.IO.ColorScheme()

Callers 1

runCommandFunction · 0.70

Calls 2

NewFinderFunction · 0.92
reopenRunFunction · 0.70

Tested by 1

runCommandFunction · 0.56