mirror of https://github.com/docker/cli.git
Merge pull request #26716 from dnephin/move-system-commands
Create system subcommand
This commit is contained in:
commit
b7722cd80a
|
@ -29,16 +29,17 @@ func AddCommands(cmd *cobra.Command, dockerCli *command.DockerCli) {
|
||||||
swarm.NewSwarmCommand(dockerCli),
|
swarm.NewSwarmCommand(dockerCli),
|
||||||
container.NewContainerCommand(dockerCli),
|
container.NewContainerCommand(dockerCli),
|
||||||
image.NewImageCommand(dockerCli),
|
image.NewImageCommand(dockerCli),
|
||||||
|
system.NewSystemCommand(dockerCli),
|
||||||
container.NewRunCommand(dockerCli),
|
container.NewRunCommand(dockerCli),
|
||||||
image.NewBuildCommand(dockerCli),
|
image.NewBuildCommand(dockerCli),
|
||||||
network.NewNetworkCommand(dockerCli),
|
network.NewNetworkCommand(dockerCli),
|
||||||
system.NewEventsCommand(dockerCli),
|
hide(system.NewEventsCommand(dockerCli)),
|
||||||
registry.NewLoginCommand(dockerCli),
|
registry.NewLoginCommand(dockerCli),
|
||||||
registry.NewLogoutCommand(dockerCli),
|
registry.NewLogoutCommand(dockerCli),
|
||||||
registry.NewSearchCommand(dockerCli),
|
registry.NewSearchCommand(dockerCli),
|
||||||
system.NewVersionCommand(dockerCli),
|
system.NewVersionCommand(dockerCli),
|
||||||
volume.NewVolumeCommand(dockerCli),
|
volume.NewVolumeCommand(dockerCli),
|
||||||
system.NewInfoCommand(dockerCli),
|
hide(system.NewInfoCommand(dockerCli)),
|
||||||
hide(container.NewAttachCommand(dockerCli)),
|
hide(container.NewAttachCommand(dockerCli)),
|
||||||
hide(container.NewCommitCommand(dockerCli)),
|
hide(container.NewCommitCommand(dockerCli)),
|
||||||
hide(container.NewCopyCommand(dockerCli)),
|
hide(container.NewCopyCommand(dockerCli)),
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/docker/docker/cli"
|
||||||
|
"github.com/docker/docker/cli/command"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewSystemCommand returns a cobra command for `system` subcommands
|
||||||
|
func NewSystemCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "system",
|
||||||
|
Short: "Manage Docker",
|
||||||
|
Args: cli.NoArgs,
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
||||||
|
},
|
||||||
|
}
|
||||||
|
cmd.AddCommand(
|
||||||
|
NewEventsCommand(dockerCli),
|
||||||
|
NewInfoCommand(dockerCli),
|
||||||
|
)
|
||||||
|
return cmd
|
||||||
|
}
|
Loading…
Reference in New Issue