FormatQuestion formats a yes/no question with the appropriate choice indicator
(question string, optimistic bool)
| 25 | |
| 26 | // FormatQuestion formats a yes/no question with the appropriate choice indicator |
| 27 | func 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. |
no outgoing calls