(name string, message string, help string, options []string, defaultValue string, required bool)
| 105 | } |
| 106 | |
| 107 | func SelectInput(name string, message string, help string, options []string, defaultValue string, required bool) *survey.Question { |
| 108 | // Force options "page" size to full, |
| 109 | // since there's not visual clue about extra options. |
| 110 | pageSize := len(options) |
| 111 | input := &survey.Question{ |
| 112 | Name: name, |
| 113 | Prompt: &survey.Select{Message: message, Help: help, Options: options, PageSize: pageSize, Default: defaultValue}, |
| 114 | } |
| 115 | |
| 116 | if required { |
| 117 | input.Validate = survey.Required |
| 118 | } |
| 119 | |
| 120 | return input |
| 121 | } |
| 122 | |
| 123 | func PasswordInput(name string, message string, required bool) *survey.Question { |
| 124 | input := &survey.Question{ |
no outgoing calls
no test coverage detected