1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #14626 from kunalkushwaha/add-network-cli-help

"docker network" missing from docker --help
This commit is contained in:
David Calavera 2015-09-09 13:36:43 -07:00
commit a796ac5318
3 changed files with 22 additions and 8 deletions

View file

@ -3,8 +3,6 @@
package client
import (
"os"
nwclient "github.com/docker/libnetwork/client"
)
@ -12,5 +10,5 @@ import (
func (cli *DockerCli) CmdNetwork(args ...string) error {
nCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))
args = append([]string{"network"}, args...)
return nCli.Cmd(os.Args[0], args...)
return nCli.Cmd("docker", args...)
}

View file

@ -0,0 +1,12 @@
// +build experimental
package main
import "sort"
func init() {
dockerCommands = append(dockerCommands, command{"network", "Network management"})
//Sorting logic required here to pass Command Sort Test.
sort.Sort(byName(dockerCommands))
}

View file

@ -202,9 +202,10 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
// These commands will never print a short-usage so don't test
noShortUsage := map[string]string{
"images": "",
"login": "",
"logout": "",
"images": "",
"login": "",
"logout": "",
"network": "",
}
if _, ok := noShortUsage[cmd]; !ok {
@ -257,11 +258,14 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
}
expected := 40
// Number of commands for standard release and experimental release
standard := 40
experimental := 1
expected := standard + experimental
if isLocalDaemon {
expected++ // for the daemon command
}
if len(cmds) != expected {
if len(cmds) > expected {
c.Fatalf("Wrong # of cmds(%d), it should be: %d\nThe list:\n%q",
len(cmds), expected, cmds)
}