(inv *serpent.Invocation)
| 625 | } |
| 626 | |
| 627 | func promptCountry(inv *serpent.Invocation) (string, error) { |
| 628 | options := make([]string, len(codersdk.Countries)) |
| 629 | for i, country := range codersdk.Countries { |
| 630 | options[i] = country.Name |
| 631 | } |
| 632 | |
| 633 | selection, err := cliui.Select(inv, cliui.SelectOptions{ |
| 634 | Options: options, |
| 635 | Message: "Select the country:", |
| 636 | HideSearch: false, |
| 637 | }) |
| 638 | if err != nil { |
| 639 | return "", xerrors.Errorf("select country: %w", err) |
| 640 | } |
| 641 | return selection, nil |
| 642 | } |