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)
| 121 | // completeScaleArgs returns a completion function for the args of the scale command. |
| 122 | // It completes service names followed by "=", suppressing the trailing space. |
| 123 | func 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 | } |
no test coverage detected
searching dependent graphs…