Introduce functional arguments to NewDockerCli for a more stable API.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki
2019-01-28 14:52:58 +01:00
parent eb0ba4f8d5
commit 7f207f3f95
7 changed files with 214 additions and 46 deletions
+4 -3
View File
@@ -10,7 +10,6 @@ import (
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/commands"
"github.com/docker/docker/pkg/term"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
@@ -18,8 +17,10 @@ import (
const descriptionSourcePath = "docs/reference/commandline/"
func generateCliYaml(opts *options) error {
stdin, stdout, stderr := term.StdStreams()
dockerCli := command.NewDockerCli(stdin, stdout, stderr, false, nil)
dockerCli, err := command.NewDockerCli()
if err != nil {
return err
}
cmd := &cobra.Command{Use: "docker"}
commands.AddCommands(cmd, dockerCli)
disableFlagsInUseLine(cmd)