From fac425608a53091aa9033c37cac1eea127356e26 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 6 Jun 2016 10:28:52 +0200 Subject: [PATCH] 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 --- cobraadaptor/adaptor.go | 2 ++ usage.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cobraadaptor/adaptor.go b/cobraadaptor/adaptor.go index a3df870cb7..4ceb57757d 100644 --- a/cobraadaptor/adaptor.go +++ b/cobraadaptor/adaptor.go @@ -4,6 +4,7 @@ import ( "github.com/docker/docker/api/client" "github.com/docker/docker/api/client/container" "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/cli" cliflags "github.com/docker/docker/cli/flags" @@ -43,6 +44,7 @@ func NewCobraAdaptor(clientFlags *cliflags.ClientFlags) CobraAdaptor { container.NewUnpauseCommand(dockerCli), image.NewRemoveCommand(dockerCli), image.NewSearchCommand(dockerCli), + network.NewNetworkCommand(dockerCli), volume.NewVolumeCommand(dockerCli), ) diff --git a/usage.go b/usage.go index b5d9e904ad..f6152e5c93 100644 --- a/usage.go +++ b/usage.go @@ -23,7 +23,6 @@ var DockerCommandUsage = []Command{ {"load", "Load an image from a tar archive or STDIN"}, {"login", "Log in to a Docker registry"}, {"logout", "Log out from a Docker registry"}, - {"network", "Manage Docker networks"}, {"pause", "Pause all processes within a container"}, {"port", "List port mappings or a specific mapping for the CONTAINER"}, {"ps", "List containers"},