Migrate network command to cobra

- Migrates network command and subcommands (connect, create, disconnect,
  inspect, list and remove) to spf13/cobra
- Create a RequiredExactArgs helper function for command that require an
  exact number of arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-06-06 10:28:52 +02:00
parent c23f4c9b48
commit fac425608a
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/docker/docker/api/client" "github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/container" "github.com/docker/docker/api/client/container"
"github.com/docker/docker/api/client/image" "github.com/docker/docker/api/client/image"
"github.com/docker/docker/api/client/network"
"github.com/docker/docker/api/client/volume" "github.com/docker/docker/api/client/volume"
"github.com/docker/docker/cli" "github.com/docker/docker/cli"
cliflags "github.com/docker/docker/cli/flags" cliflags "github.com/docker/docker/cli/flags"
@ -43,6 +44,7 @@ func NewCobraAdaptor(clientFlags *cliflags.ClientFlags) CobraAdaptor {
container.NewUnpauseCommand(dockerCli), container.NewUnpauseCommand(dockerCli),
image.NewRemoveCommand(dockerCli), image.NewRemoveCommand(dockerCli),
image.NewSearchCommand(dockerCli), image.NewSearchCommand(dockerCli),
network.NewNetworkCommand(dockerCli),
volume.NewVolumeCommand(dockerCli), volume.NewVolumeCommand(dockerCli),
) )

View File

@ -23,7 +23,6 @@ var DockerCommandUsage = []Command{
{"load", "Load an image from a tar archive or STDIN"}, {"load", "Load an image from a tar archive or STDIN"},
{"login", "Log in to a Docker registry"}, {"login", "Log in to a Docker registry"},
{"logout", "Log out from a Docker registry"}, {"logout", "Log out from a Docker registry"},
{"network", "Manage Docker networks"},
{"pause", "Pause all processes within a container"}, {"pause", "Pause all processes within a container"},
{"port", "List port mappings or a specific mapping for the CONTAINER"}, {"port", "List port mappings or a specific mapping for the CONTAINER"},
{"ps", "List containers"}, {"ps", "List containers"},