github.com/itscaro/cli@v0.0.0-20190705081621-c9db0fe93829/cli/command/swarm/cmd.go (about) 1 package swarm 2 3 import ( 4 "github.com/spf13/cobra" 5 6 "github.com/docker/cli/cli" 7 "github.com/docker/cli/cli/command" 8 ) 9 10 // NewSwarmCommand returns a cobra command for `swarm` subcommands 11 func NewSwarmCommand(dockerCli command.Cli) *cobra.Command { 12 cmd := &cobra.Command{ 13 Use: "swarm", 14 Short: "Manage Swarm", 15 Args: cli.NoArgs, 16 RunE: command.ShowHelp(dockerCli.Err()), 17 Annotations: map[string]string{ 18 "version": "1.24", 19 "swarm": "", 20 }, 21 } 22 cmd.AddCommand( 23 newInitCommand(dockerCli), 24 newJoinCommand(dockerCli), 25 newJoinTokenCommand(dockerCli), 26 newUnlockKeyCommand(dockerCli), 27 newUpdateCommand(dockerCli), 28 newLeaveCommand(dockerCli), 29 newUnlockCommand(dockerCli), 30 newCACommand(dockerCli), 31 ) 32 return cmd 33 }