newSwarmCommand returns a cobra command for `swarm` subcommands
(dockerCLI command.Cli)
| 14 | |
| 15 | // newSwarmCommand returns a cobra command for `swarm` subcommands |
| 16 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…