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

Function confirm

pkg/server/cmd/user.go:30–40  ·  view source on GitHub ↗

confirm prompts for user input to confirm a choice

(r io.Reader, question string, optimistic bool)

Source from the content-addressed store, hash-verified

28
29// confirm prompts for user input to confirm a choice
30func confirm(r io.Reader, question string, optimistic bool) (bool, error) {
31 message := prompt.FormatQuestion(question, optimistic)
32 fmt.Print(message + " ")
33
34 confirmed, err := prompt.ReadYesNo(r, optimistic)
35 if err != nil {
36 return false, errors.Wrap(err, "reading stdin")
37 }
38
39 return confirmed, nil
40}
41
42func userCreateCmd(args []string) {
43 fs := setupFlagSet("create", "dnote-server user create")

Callers 1

userRemoveCmdFunction · 0.85

Calls 2

FormatQuestionFunction · 0.92
ReadYesNoFunction · 0.92

Tested by

no test coverage detected