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

Function newScaleCommand

cli/command/service/scale.go:20–37  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

18}
19
20func 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
39func scaleArgs(cmd *cobra.Command, args []string) error {
40 if err := cli.RequiresMinArgs(1)(cmd, args); err != nil {

Callers 1

newServiceCommandFunction · 0.85

Calls 3

runScaleFunction · 0.85
completeScaleArgsFunction · 0.85
addDetachFlagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…