Merge pull request #1633 from silvin-lubecki/refactor-docker-cli-construction

Introduce functional arguments to NewDockerCli for a more stable API.
This commit is contained in:
Vincent Demeester 2019-01-28 15:39:34 +01:00 коммит произвёл GitHub
Родитель 7b450d9183 7b92a8c365
Коммит 2672072c19
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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)