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

Function newSwarmCommand

cli/command/swarm/cmd.go:16–39  ·  view source on GitHub ↗

newSwarmCommand returns a cobra command for `swarm` subcommands

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

14
15// newSwarmCommand returns a cobra command for `swarm` subcommands
16func newSwarmCommand(dockerCLI command.Cli) *cobra.Command {
17 cmd := &cobra.Command{
18 Use: "swarm",
19 Short: "Manage Swarm",
20 Args: cli.NoArgs,
21 RunE: command.ShowHelp(dockerCLI.Err()),
22 Annotations: map[string]string{
23 "version": "1.24",
24 "swarm": "", // swarm command itself does not require swarm to be enabled (so swarm init and join is always available on API 1.24 and up)
25 },
26 DisableFlagsInUseLine: true,
27 }
28 cmd.AddCommand(
29 newInitCommand(dockerCLI),
30 newJoinCommand(dockerCLI),
31 newJoinTokenCommand(dockerCLI),
32 newUnlockKeyCommand(dockerCLI),
33 newUpdateCommand(dockerCLI),
34 newLeaveCommand(dockerCLI),
35 newUnlockCommand(dockerCLI),
36 newCACommand(dockerCLI),
37 )
38 return cmd
39}

Callers

nothing calls this directly

Calls 9

newInitCommandFunction · 0.85
newJoinCommandFunction · 0.85
newJoinTokenCommandFunction · 0.85
newUnlockKeyCommandFunction · 0.85
newLeaveCommandFunction · 0.85
newUnlockCommandFunction · 0.85
newCACommandFunction · 0.85
newUpdateCommandFunction · 0.70
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…