MCPcopy
hub / github.com/dagger/container-use / suggestEnvironments

Function suggestEnvironments

cmd/container-use/main.go:53–71  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string, toComplete string)

Source from the content-addressed store, hash-verified

51}
52
53func 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}

Callers

nothing calls this directly

Calls 2

OpenFunction · 0.92
ListMethod · 0.80

Tested by

no test coverage detected