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

Function completeScaleArgs

cli/command/service/scale.go:123–135  ·  view source on GitHub ↗

completeScaleArgs returns a completion function for the args of the scale command. It completes service names followed by "=", suppressing the trailing space.

(dockerCli command.Cli)

Source from the content-addressed store, hash-verified

121// completeScaleArgs returns a completion function for the args of the scale command.
122// It completes service names followed by "=", suppressing the trailing space.
123func completeScaleArgs(dockerCli command.Cli) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
124 return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
125 // reuse the existing logic for configurable completion of service names and IDs.
126 completions, directive := completeServiceNames(dockerCli)(cmd, args, toComplete)
127 if directive == cobra.ShellCompDirectiveError {
128 return completions, directive
129 }
130 for i, v := range completions {
131 completions[i] = v + "="
132 }
133 return completions, directive | cobra.ShellCompDirectiveNoSpace
134 }
135}

Callers 1

newScaleCommandFunction · 0.85

Calls 1

completeServiceNamesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…