(cmd *cobra.Command, args []string, toComplete string)
| 51 | } |
| 52 | |
| 53 | func suggestEnvironments(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 54 | ctx := cmd.Context() |
| 55 | |
| 56 | repo, err := repository.Open(ctx, ".") |
| 57 | if err != nil { |
| 58 | return nil, cobra.ShellCompDirectiveError |
| 59 | } |
| 60 | |
| 61 | envs, err := repo.List(ctx) |
| 62 | if err != nil { |
| 63 | return nil, cobra.ShellCompDirectiveError |
| 64 | } |
| 65 | |
| 66 | ids := []string{} |
| 67 | for _, e := range envs { |
| 68 | ids = append(ids, e.ID) |
| 69 | } |
| 70 | return ids, cobra.ShellCompDirectiveKeepOrder |
| 71 | } |