diff --git a/cli/command/cli_options.go b/cli/command/cli_options.go index 535a6d5338..d714947cb9 100644 --- a/cli/command/cli_options.go +++ b/cli/command/cli_options.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/docker/cli/cli/streams" + "github.com/docker/docker/client" "github.com/moby/term" ) @@ -86,3 +87,11 @@ func WithDefaultContextStoreConfig() DockerCliOption { return nil } } + +// WithAPIClient configures the cli to use the given API client. +func WithAPIClient(c client.APIClient) DockerCliOption { + return func(cli *DockerCli) error { + cli.client = c + return nil + } +}