MCPcopy Create free account
hub / github.com/dnote/dnote / FormatQuestion

Function FormatQuestion

pkg/prompt/prompt.go:27–33  ·  view source on GitHub ↗

FormatQuestion formats a yes/no question with the appropriate choice indicator

(question string, optimistic bool)

Source from the content-addressed store, hash-verified

25
26// FormatQuestion formats a yes/no question with the appropriate choice indicator
27func FormatQuestion(question string, optimistic bool) string {
28 choices := "(y/N)"
29 if optimistic {
30 choices = "(Y/n)"
31 }
32 return fmt.Sprintf("%s %s", question, choices)
33}
34
35// ReadYesNo reads and parses a yes/no response from the given reader.
36// Returns true if confirmed, respecting optimistic mode.

Callers 3

ConfirmFunction · 0.92
confirmFunction · 0.92
TestFormatQuestionFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFormatQuestionFunction · 0.68