github.com/kunnos/engine@v1.13.1/cli/command/stack/cmd.go (about)

     1  package stack
     2  
     3  import (
     4  	"github.com/docker/docker/cli"
     5  	"github.com/docker/docker/cli/command"
     6  	"github.com/spf13/cobra"
     7  )
     8  
     9  // NewStackCommand returns a cobra command for `stack` subcommands
    10  func NewStackCommand(dockerCli *command.DockerCli) *cobra.Command {
    11  	cmd := &cobra.Command{
    12  		Use:   "stack",
    13  		Short: "Manage Docker stacks",
    14  		Args:  cli.NoArgs,
    15  		RunE:  dockerCli.ShowHelp,
    16  		Tags:  map[string]string{"version": "1.25"},
    17  	}
    18  	cmd.AddCommand(
    19  		newDeployCommand(dockerCli),
    20  		newListCommand(dockerCli),
    21  		newRemoveCommand(dockerCli),
    22  		newServicesCommand(dockerCli),
    23  		newPsCommand(dockerCli),
    24  	)
    25  	return cmd
    26  }
    27  
    28  // NewTopLevelDeployCommand returns a command for `docker deploy`
    29  func NewTopLevelDeployCommand(dockerCli *command.DockerCli) *cobra.Command {
    30  	cmd := newDeployCommand(dockerCli)
    31  	// Remove the aliases at the top level
    32  	cmd.Aliases = []string{}
    33  	cmd.Tags = map[string]string{"experimental": "", "version": "1.25"}
    34  	return cmd
    35  }