(options []string, answers ...string)
| 157 | } |
| 158 | |
| 159 | func IndexesFor(options []string, answers ...string) ([]int, error) { |
| 160 | indexes := make([]int, len(answers)) |
| 161 | for i, answer := range answers { |
| 162 | index, err := IndexFor(options, answer) |
| 163 | if err != nil { |
| 164 | return nil, err |
| 165 | } |
| 166 | indexes[i] = index |
| 167 | } |
| 168 | return indexes, nil |
| 169 | } |
| 170 | |
| 171 | func NoSuchPromptErr(prompt string) error { |
| 172 | return fmt.Errorf("no such prompt '%s'", prompt) |