2016-09-08 13:11:39 -04:00
|
|
|
package network
|
|
|
|
|
|
|
|
import (
|
2017-04-17 18:07:56 -04:00
|
|
|
"github.com/docker/cli/cli"
|
|
|
|
"github.com/docker/cli/cli/command"
|
2022-03-30 09:27:25 -04:00
|
|
|
"github.com/spf13/cobra"
|
2016-09-08 13:11:39 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewNetworkCommand returns a cobra command for `network` subcommands
|
2017-06-21 05:25:25 -04:00
|
|
|
func NewNetworkCommand(dockerCli command.Cli) *cobra.Command {
|
2016-09-08 13:11:39 -04:00
|
|
|
cmd := &cobra.Command{
|
2019-01-29 19:06:09 -05:00
|
|
|
Use: "network",
|
|
|
|
Short: "Manage networks",
|
|
|
|
Args: cli.NoArgs,
|
|
|
|
RunE: command.ShowHelp(dockerCli.Err()),
|
|
|
|
Annotations: map[string]string{"version": "1.21"},
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
|
|
newConnectCommand(dockerCli),
|
|
|
|
newCreateCommand(dockerCli),
|
|
|
|
newDisconnectCommand(dockerCli),
|
|
|
|
newInspectCommand(dockerCli),
|
|
|
|
newListCommand(dockerCli),
|
|
|
|
newRemoveCommand(dockerCli),
|
2016-10-18 00:36:52 -04:00
|
|
|
NewPruneCommand(dockerCli),
|
2016-09-08 13:11:39 -04:00
|
|
|
)
|
|
|
|
return cmd
|
|
|
|
}
|