confirm prompts for user input to confirm a choice
(r io.Reader, question string, optimistic bool)
| 28 | |
| 29 | // confirm prompts for user input to confirm a choice |
| 30 | func 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 | |
| 42 | func userCreateCmd(args []string) { |
| 43 | fs := setupFlagSet("create", "dnote-server user create") |
no test coverage detected