MCPcopy
hub / github.com/cli/cli / TitleSurvey

Function TitleSurvey

pkg/cmd/pr/shared/survey.go:116–136  ·  view source on GitHub ↗
(p Prompt, io *iostreams.IOStreams, state *IssueMetadataState)

Source from the content-addressed store, hash-verified

114}
115
116func TitleSurvey(p Prompt, io *iostreams.IOStreams, state *IssueMetadataState) error {
117 var err error
118 result := ""
119 for result == "" {
120 result, err = p.Input("Title (required)", state.Title)
121 if err != nil {
122 return err
123 }
124 if result == "" {
125 fmt.Fprintf(io.ErrOut, "%s Title cannot be blank\n", io.ColorScheme().FailureIcon())
126 }
127 }
128
129 if result != state.Title {
130 state.MarkDirty()
131 }
132
133 state.Title = result
134
135 return nil
136}
137
138type MetadataFetcher struct {
139 IO *iostreams.IOStreams

Callers 2

createRunFunction · 0.92
TestTitleSurveyFunction · 0.85

Calls 4

FailureIconMethod · 0.80
ColorSchemeMethod · 0.80
MarkDirtyMethod · 0.80
InputMethod · 0.65

Tested by 1

TestTitleSurveyFunction · 0.68