(dockerCLI command.Cli)
| 18 | } |
| 19 | |
| 20 | func newScaleCommand(dockerCLI command.Cli) *cobra.Command { |
| 21 | options := &scaleOptions{} |
| 22 | |
| 23 | cmd := &cobra.Command{ |
| 24 | Use: "scale SERVICE=REPLICAS [SERVICE=REPLICAS...]", |
| 25 | Short: "Scale one or multiple replicated services", |
| 26 | Args: scaleArgs, |
| 27 | RunE: func(cmd *cobra.Command, args []string) error { |
| 28 | return runScale(cmd.Context(), dockerCLI, options, args) |
| 29 | }, |
| 30 | ValidArgsFunction: completeScaleArgs(dockerCLI), |
| 31 | DisableFlagsInUseLine: true, |
| 32 | } |
| 33 | |
| 34 | flags := cmd.Flags() |
| 35 | addDetachFlag(flags, &options.detach) |
| 36 | return cmd |
| 37 | } |
| 38 | |
| 39 | func scaleArgs(cmd *cobra.Command, args []string) error { |
| 40 | if err := cli.RequiresMinArgs(1)(cmd, args); err != nil { |
no test coverage detected
searching dependent graphs…