github.com/justincormack/cli@v0.0.0-20201215022714-831ebeae9675/cli/command/service/cmd.go (about) 1 package service 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 // NewServiceCommand returns a cobra command for `service` subcommands 11 func NewServiceCommand(dockerCli command.Cli) *cobra.Command { 12 cmd := &cobra.Command{ 13 Use: "service", 14 Short: "Manage services", 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 newCreateCommand(dockerCli), 24 newInspectCommand(dockerCli), 25 newPsCommand(dockerCli), 26 newListCommand(dockerCli), 27 newRemoveCommand(dockerCli), 28 newScaleCommand(dockerCli), 29 newUpdateCommand(dockerCli), 30 newLogsCommand(dockerCli), 31 newRollbackCommand(dockerCli), 32 ) 33 return cmd 34 }