MCPcopy
hub / github.com/cli/cli / runView

Function runView

pkg/cmd/project/view/view.go:84–105  ·  view source on GitHub ↗
(config viewConfig)

Source from the content-addressed store, hash-verified

82}
83
84func runView(config viewConfig) error {
85 canPrompt := config.io.CanPrompt()
86 owner, err := config.client.NewOwner(canPrompt, config.opts.owner)
87 if err != nil {
88 return err
89 }
90
91 project, err := config.client.NewProject(canPrompt, owner, config.opts.number, true)
92 if err != nil {
93 return err
94 }
95
96 if config.opts.web {
97 return config.URLOpener(project.URL)
98 }
99
100 if config.opts.exporter != nil {
101 return config.opts.exporter.Write(config.io, *project)
102 }
103
104 return printResults(config, project)
105}
106
107func printResults(config viewConfig, project *queries.Project) error {
108 var sb strings.Builder

Callers 8

TestRunView_UserFunction · 0.70
TestRunView_ViewerFunction · 0.70
TestRunView_OrgFunction · 0.70
TestRunViewWeb_UserFunction · 0.70
TestRunViewWeb_OrgFunction · 0.70
TestRunViewWeb_MeFunction · 0.70
TestRunViewWeb_TTYFunction · 0.70
NewCmdViewFunction · 0.70

Calls 5

CanPromptMethod · 0.80
NewOwnerMethod · 0.80
NewProjectMethod · 0.80
printResultsFunction · 0.70
WriteMethod · 0.65

Tested by 7

TestRunView_UserFunction · 0.56
TestRunView_ViewerFunction · 0.56
TestRunView_OrgFunction · 0.56
TestRunViewWeb_UserFunction · 0.56
TestRunViewWeb_OrgFunction · 0.56
TestRunViewWeb_MeFunction · 0.56
TestRunViewWeb_TTYFunction · 0.56