root.go 743 B

1234567891011121314151617181920212223242526272829303132
  1. package commands
  2. import (
  3. "fmt"
  4. "github.com/docker/cli/cli/command"
  5. "github.com/spf13/cobra"
  6. )
  7. // NewRootCmd returns the base root command.
  8. func NewRootCmd(dockerCli command.Cli) *cobra.Command {
  9. cmd := &cobra.Command{
  10. Short: "Docker ECS",
  11. Long: `run multi-container applications on Amazon ECS.`,
  12. Use: "ecs",
  13. Annotations: map[string]string{"experimentalCLI": "true"},
  14. RunE: func(cmd *cobra.Command, args []string) error {
  15. if len(args) != 0 {
  16. return fmt.Errorf("%q is not a docker ecs command\nSee 'docker ecs --help'", args[0])
  17. }
  18. cmd.Help()
  19. return nil
  20. },
  21. }
  22. cmd.AddCommand(
  23. VersionCommand(),
  24. ComposeCommand(dockerCli),
  25. SecretCommand(dockerCli),
  26. SetupCommand(),
  27. )
  28. return cmd
  29. }