MCPcopy Index your code
hub / github.com/docker/cli / completeNames

Function completeNames

cli/command/stack/cmd.go:54–66  ·  view source on GitHub ↗

completeNames offers completion for swarm stacks

(dockerCLI completion.APIClientProvider)

Source from the content-addressed store, hash-verified

52
53// completeNames offers completion for swarm stacks
54func completeNames(dockerCLI completion.APIClientProvider) cobra.CompletionFunc {
55 return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
56 list, err := getStacks(cmd.Context(), dockerCLI.Client())
57 if err != nil {
58 return nil, cobra.ShellCompDirectiveError
59 }
60 var names []string
61 for _, stack := range list {
62 names = append(names, stack.Name)
63 }
64 return names, cobra.ShellCompDirectiveNoFileComp
65 }
66}

Callers 4

newRemoveCommandFunction · 0.70
newPsCommandFunction · 0.70
newServicesCommandFunction · 0.70
newDeployCommandFunction · 0.70

Calls 2

getStacksFunction · 0.85
ClientMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…