github.com/kunnos/engine@v1.13.1/cli/command/commands/commands.go (about) 1 package commands 2 3 import ( 4 "os" 5 6 "github.com/docker/docker/cli/command" 7 "github.com/docker/docker/cli/command/checkpoint" 8 "github.com/docker/docker/cli/command/container" 9 "github.com/docker/docker/cli/command/image" 10 "github.com/docker/docker/cli/command/network" 11 "github.com/docker/docker/cli/command/node" 12 "github.com/docker/docker/cli/command/plugin" 13 "github.com/docker/docker/cli/command/registry" 14 "github.com/docker/docker/cli/command/secret" 15 "github.com/docker/docker/cli/command/service" 16 "github.com/docker/docker/cli/command/stack" 17 "github.com/docker/docker/cli/command/swarm" 18 "github.com/docker/docker/cli/command/system" 19 "github.com/docker/docker/cli/command/volume" 20 "github.com/spf13/cobra" 21 ) 22 23 // AddCommands adds all the commands from cli/command to the root command 24 func AddCommands(cmd *cobra.Command, dockerCli *command.DockerCli) { 25 cmd.AddCommand( 26 node.NewNodeCommand(dockerCli), 27 service.NewServiceCommand(dockerCli), 28 swarm.NewSwarmCommand(dockerCli), 29 secret.NewSecretCommand(dockerCli), 30 container.NewContainerCommand(dockerCli), 31 image.NewImageCommand(dockerCli), 32 system.NewSystemCommand(dockerCli), 33 container.NewRunCommand(dockerCli), 34 image.NewBuildCommand(dockerCli), 35 network.NewNetworkCommand(dockerCli), 36 hide(system.NewEventsCommand(dockerCli)), 37 registry.NewLoginCommand(dockerCli), 38 registry.NewLogoutCommand(dockerCli), 39 registry.NewSearchCommand(dockerCli), 40 system.NewVersionCommand(dockerCli), 41 volume.NewVolumeCommand(dockerCli), 42 hide(system.NewInfoCommand(dockerCli)), 43 hide(container.NewAttachCommand(dockerCli)), 44 hide(container.NewCommitCommand(dockerCli)), 45 hide(container.NewCopyCommand(dockerCli)), 46 hide(container.NewCreateCommand(dockerCli)), 47 hide(container.NewDiffCommand(dockerCli)), 48 hide(container.NewExecCommand(dockerCli)), 49 hide(container.NewExportCommand(dockerCli)), 50 hide(container.NewKillCommand(dockerCli)), 51 hide(container.NewLogsCommand(dockerCli)), 52 hide(container.NewPauseCommand(dockerCli)), 53 hide(container.NewPortCommand(dockerCli)), 54 hide(container.NewPsCommand(dockerCli)), 55 hide(container.NewRenameCommand(dockerCli)), 56 hide(container.NewRestartCommand(dockerCli)), 57 hide(container.NewRmCommand(dockerCli)), 58 hide(container.NewStartCommand(dockerCli)), 59 hide(container.NewStatsCommand(dockerCli)), 60 hide(container.NewStopCommand(dockerCli)), 61 hide(container.NewTopCommand(dockerCli)), 62 hide(container.NewUnpauseCommand(dockerCli)), 63 hide(container.NewUpdateCommand(dockerCli)), 64 hide(container.NewWaitCommand(dockerCli)), 65 hide(image.NewHistoryCommand(dockerCli)), 66 hide(image.NewImagesCommand(dockerCli)), 67 hide(image.NewImportCommand(dockerCli)), 68 hide(image.NewLoadCommand(dockerCli)), 69 hide(image.NewPullCommand(dockerCli)), 70 hide(image.NewPushCommand(dockerCli)), 71 hide(image.NewRemoveCommand(dockerCli)), 72 hide(image.NewSaveCommand(dockerCli)), 73 hide(image.NewTagCommand(dockerCli)), 74 hide(system.NewInspectCommand(dockerCli)), 75 stack.NewStackCommand(dockerCli), 76 stack.NewTopLevelDeployCommand(dockerCli), 77 checkpoint.NewCheckpointCommand(dockerCli), 78 plugin.NewPluginCommand(dockerCli), 79 ) 80 81 } 82 83 func hide(cmd *cobra.Command) *cobra.Command { 84 if os.Getenv("DOCKER_HIDE_LEGACY_COMMANDS") == "" { 85 return cmd 86 } 87 cmdCopy := *cmd 88 cmdCopy.Hidden = true 89 cmdCopy.Aliases = []string{} 90 return &cmdCopy 91 }