MCPcopy
hub / github.com/cli/cli / Confirm

Method Confirm

pkg/cmd/codespace/delete.go:222–240  ·  view source on GitHub ↗
(message string)

Source from the content-addressed store, hash-verified

220type surveyPrompter struct{}
221
222func (p *surveyPrompter) Confirm(message string) (bool, error) {
223 prompter := &Prompter{}
224 var confirmed struct {
225 Confirmed bool
226 }
227 q := []*survey.Question{
228 {
229 Name: "confirmed",
230 Prompt: &survey.Confirm{
231 Message: message,
232 },
233 },
234 }
235 if err := prompter.Ask(q, &confirmed); err != nil {
236 return false, fmt.Errorf("failed to prompt: %w", err)
237 }
238
239 return confirmed.Confirmed, nil
240}

Callers

nothing calls this directly

Calls 2

AskMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected