From 8d968c393d0288be80edb2942defef3ccb8713a8 Mon Sep 17 00:00:00 2001
From: Nicolas De Loof <nicolas.deloof@gmail.com>
Date: Fri, 25 Feb 2022 16:29:08 +0100
Subject: [PATCH] Add support for command line completion by docker/cli (see
 https://github.com/docker/cli/pull/3429)

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
---
 cmd/compose/build.go         |  2 +-
 cmd/compose/completion.go    | 19 ++++++++++++++++++-
 cmd/compose/compose.go       | 17 +++++++++++------
 cmd/compose/convert.go       |  2 +-
 cmd/compose/cp.go            |  2 +-
 cmd/compose/create.go        |  2 +-
 cmd/compose/events.go        |  2 +-
 cmd/compose/exec.go          |  2 +-
 cmd/compose/images.go        |  2 +-
 cmd/compose/kill.go          |  2 +-
 cmd/compose/logs.go          |  2 +-
 cmd/compose/pause.go         |  4 ++--
 cmd/compose/port.go          |  2 +-
 cmd/compose/ps.go            |  2 +-
 cmd/compose/pull.go          |  2 +-
 cmd/compose/push.go          |  2 +-
 cmd/compose/remove.go        |  2 +-
 cmd/compose/restart.go       |  2 +-
 cmd/compose/run.go           |  2 +-
 cmd/compose/start.go         |  2 +-
 cmd/compose/stop.go          |  2 +-
 cmd/compose/top.go           |  2 +-
 cmd/compose/up.go            |  2 +-
 cmd/main.go                  |  1 +
 go.mod                       |  2 +-
 go.sum                       |  4 ++--
 pkg/mocks/mock_docker_cli.go | 14 --------------
 27 files changed, 55 insertions(+), 46 deletions(-)

diff --git a/cmd/compose/build.go b/cmd/compose/build.go
index 298d3b67518..ac3c5998289 100644
--- a/cmd/compose/build.go
+++ b/cmd/compose/build.go
@@ -102,7 +102,7 @@ func buildCommand(p *projectOptions, backend api.Service) *cobra.Command {
 			}
 			return runBuild(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Don't print anything to STDOUT")
 	cmd.Flags().BoolVar(&opts.pull, "pull", false, "Always attempt to pull a newer version of the image.")
diff --git a/cmd/compose/completion.go b/cmd/compose/completion.go
index 891539b6b7c..c54efa8df00 100644
--- a/cmd/compose/completion.go
+++ b/cmd/compose/completion.go
@@ -19,6 +19,7 @@ package compose
 import (
 	"strings"
 
+	"github.com/docker/compose/v2/pkg/api"
 	"github.com/spf13/cobra"
 )
 
@@ -31,7 +32,7 @@ func noCompletion() validArgsFn {
 	}
 }
 
-func serviceCompletion(p *projectOptions) validArgsFn {
+func completeServiceNames(p *projectOptions) validArgsFn {
 	return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
 		project, err := p.toProject(nil)
 		if err != nil {
@@ -46,3 +47,19 @@ func serviceCompletion(p *projectOptions) validArgsFn {
 		return serviceNames, cobra.ShellCompDirectiveNoFileComp
 	}
 }
+
+func completeProjectNames(backend api.Service) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+	return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+		list, err := backend.List(cmd.Context(), api.ListOptions{
+			All: true,
+		})
+		if err != nil {
+			return nil, cobra.ShellCompDirectiveError
+		}
+		var values []string
+		for _, stack := range list {
+			values = append(values, stack.Name)
+		}
+		return values, cobra.ShellCompDirectiveNoFileComp
+	}
+}
diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go
index bcba67d1e5f..49262901c37 100644
--- a/cmd/compose/compose.go
+++ b/cmd/compose/compose.go
@@ -28,7 +28,6 @@ import (
 	"github.com/compose-spec/compose-go/cli"
 	"github.com/compose-spec/compose-go/types"
 	dockercli "github.com/docker/cli/cli"
-	"github.com/docker/cli/cli-plugins/manager"
 	"github.com/docker/cli/cli/command"
 	"github.com/morikuni/aec"
 	"github.com/pkg/errors"
@@ -224,11 +223,6 @@ func (o *projectOptions) toProjectOptions(po ...cli.ProjectOptionsFn) (*cli.Proj
 // PluginName is the name of the plugin
 const PluginName = "compose"
 
-// RunningAsStandalone detects when running as a standalone program
-func RunningAsStandalone() bool {
-	return len(os.Args) < 2 || os.Args[1] != manager.MetadataSubcommandName && os.Args[1] != PluginName
-}
-
 // RootCommand returns the compose command with its child commands
 func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command {
 	opts := projectOptions{}
@@ -324,6 +318,17 @@ func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command {
 	)
 	command.Flags().SetInterspersed(false)
 	opts.addProjectFlags(command.Flags())
+	command.RegisterFlagCompletionFunc( //nolint:errcheck
+		"project-name",
+		completeProjectNames(backend),
+	)
+	command.RegisterFlagCompletionFunc( //nolint:errcheck
+		"file",
+		func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+			return []string{"yaml", "yml"}, cobra.ShellCompDirectiveFilterFileExt
+		},
+	)
+
 	command.Flags().StringVar(&ansi, "ansi", "auto", `Control when to print ANSI control characters ("never"|"always"|"auto")`)
 	command.Flags().BoolVarP(&version, "version", "v", false, "Show the Docker Compose version information")
 	command.Flags().MarkHidden("version") //nolint:errcheck
diff --git a/cmd/compose/convert.go b/cmd/compose/convert.go
index 0780eabac2b..87039d08f40 100644
--- a/cmd/compose/convert.go
+++ b/cmd/compose/convert.go
@@ -92,7 +92,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
 
 			return runConvert(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := cmd.Flags()
 	flags.StringVar(&opts.Format, "format", "yaml", "Format the output. Values: [yaml | json]")
diff --git a/cmd/compose/cp.go b/cmd/compose/cp.go
index 804920754c4..d44cd3f0d6f 100644
--- a/cmd/compose/cp.go
+++ b/cmd/compose/cp.go
@@ -60,7 +60,7 @@ func copyCommand(p *projectOptions, backend api.Service) *cobra.Command {
 			opts.destination = args[1]
 			return runCopy(ctx, backend, opts)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 
 	flags := copyCmd.Flags()
diff --git a/cmd/compose/create.go b/cmd/compose/create.go
index 7ce8a1853ad..0de53c20019 100644
--- a/cmd/compose/create.go
+++ b/cmd/compose/create.go
@@ -66,7 +66,7 @@ func createCommand(p *projectOptions, backend api.Service) *cobra.Command {
 				QuietPull:            false,
 			})
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := cmd.Flags()
 	flags.BoolVar(&opts.Build, "build", false, "Build images before starting containers.")
diff --git a/cmd/compose/events.go b/cmd/compose/events.go
index 2f9e711a0e4..de0f62cc771 100644
--- a/cmd/compose/events.go
+++ b/cmd/compose/events.go
@@ -43,7 +43,7 @@ func eventsCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runEvents(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 
 	cmd.Flags().BoolVar(&opts.json, "json", false, "Output events as a stream of json objects")
diff --git a/cmd/compose/exec.go b/cmd/compose/exec.go
index 00faae6c52a..88461e0d053 100644
--- a/cmd/compose/exec.go
+++ b/cmd/compose/exec.go
@@ -61,7 +61,7 @@ func execCommand(p *projectOptions, dockerCli command.Cli, backend api.Service)
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runExec(ctx, backend, opts)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 
 	runCmd.Flags().BoolVarP(&opts.detach, "detach", "d", false, "Detached mode: Run command in the background.")
diff --git a/cmd/compose/images.go b/cmd/compose/images.go
index eebef82ebb0..68dfcf4751a 100644
--- a/cmd/compose/images.go
+++ b/cmd/compose/images.go
@@ -48,7 +48,7 @@ func imagesCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runImages(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	imgCmd.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "Only display IDs")
 	return imgCmd
diff --git a/cmd/compose/kill.go b/cmd/compose/kill.go
index eb17f1f1cb5..b3fb0bc9326 100644
--- a/cmd/compose/kill.go
+++ b/cmd/compose/kill.go
@@ -39,7 +39,7 @@ func killCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runKill(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 
 	flags := cmd.Flags()
diff --git a/cmd/compose/logs.go b/cmd/compose/logs.go
index ce094698af2..100674a1779 100644
--- a/cmd/compose/logs.go
+++ b/cmd/compose/logs.go
@@ -49,7 +49,7 @@ func logsCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runLogs(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := logsCmd.Flags()
 	flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output.")
diff --git a/cmd/compose/pause.go b/cmd/compose/pause.go
index f51f47c7a60..22f2fa4d2a5 100644
--- a/cmd/compose/pause.go
+++ b/cmd/compose/pause.go
@@ -38,7 +38,7 @@ func pauseCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runPause(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	return cmd
 }
@@ -68,7 +68,7 @@ func unpauseCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runUnPause(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	return cmd
 }
diff --git a/cmd/compose/port.go b/cmd/compose/port.go
index 6ffd6d1f93f..9f14be43e42 100644
--- a/cmd/compose/port.go
+++ b/cmd/compose/port.go
@@ -52,7 +52,7 @@ func portCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runPort(ctx, backend, opts, args[0])
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	cmd.Flags().StringVar(&opts.protocol, "protocol", "tcp", "tcp or udp")
 	cmd.Flags().IntVar(&opts.index, "index", 1, "index of the container if service has multiple replicas")
diff --git a/cmd/compose/ps.go b/cmd/compose/ps.go
index c395241adcc..26dba3391d6 100644
--- a/cmd/compose/ps.go
+++ b/cmd/compose/ps.go
@@ -77,7 +77,7 @@ func psCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runPs(ctx, backend, args, opts)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := psCmd.Flags()
 	flags.StringVar(&opts.Format, "format", "pretty", "Format the output. Values: [pretty | json]")
diff --git a/cmd/compose/pull.go b/cmd/compose/pull.go
index 59e948ed8ae..2764aa72c80 100644
--- a/cmd/compose/pull.go
+++ b/cmd/compose/pull.go
@@ -54,7 +54,7 @@ func pullCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runPull(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := cmd.Flags()
 	flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Pull without printing progress information")
diff --git a/cmd/compose/push.go b/cmd/compose/push.go
index 7e84e4c1129..628c04536e6 100644
--- a/cmd/compose/push.go
+++ b/cmd/compose/push.go
@@ -41,7 +41,7 @@ func pushCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runPush(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	pushCmd.Flags().BoolVar(&opts.Ignorefailures, "ignore-push-failures", false, "Push what it can and ignores images with push failures")
 
diff --git a/cmd/compose/remove.go b/cmd/compose/remove.go
index 8f0bbd21f07..903cee2c241 100644
--- a/cmd/compose/remove.go
+++ b/cmd/compose/remove.go
@@ -46,7 +46,7 @@ Any data which is not in a volume will be lost.`,
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runRemove(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	f := cmd.Flags()
 	f.BoolVarP(&opts.force, "force", "f", false, "Don't ask to confirm removal")
diff --git a/cmd/compose/restart.go b/cmd/compose/restart.go
index f691c31fb55..eda81c06396 100644
--- a/cmd/compose/restart.go
+++ b/cmd/compose/restart.go
@@ -40,7 +40,7 @@ func restartCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runRestart(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := restartCmd.Flags()
 	flags.IntVarP(&opts.timeout, "timeout", "t", 10, "Specify a shutdown timeout in seconds")
diff --git a/cmd/compose/run.go b/cmd/compose/run.go
index ef7e127db8e..d4f97aabd6d 100644
--- a/cmd/compose/run.go
+++ b/cmd/compose/run.go
@@ -143,7 +143,7 @@ func runCommand(p *projectOptions, dockerCli command.Cli, backend api.Service) *
 			opts.ignoreOrphans = strings.ToLower(ignore) == "true"
 			return runRun(ctx, backend, project, opts)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := cmd.Flags()
 	flags.BoolVarP(&opts.Detach, "detach", "d", false, "Run container in background and print container ID")
diff --git a/cmd/compose/start.go b/cmd/compose/start.go
index e9b67ae4403..2c79de3eefe 100644
--- a/cmd/compose/start.go
+++ b/cmd/compose/start.go
@@ -37,7 +37,7 @@ func startCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runStart(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	return startCmd
 }
diff --git a/cmd/compose/stop.go b/cmd/compose/stop.go
index 39861cd68c3..eba40a07bc2 100644
--- a/cmd/compose/stop.go
+++ b/cmd/compose/stop.go
@@ -44,7 +44,7 @@ func stopCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runStop(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := cmd.Flags()
 	flags.IntVarP(&opts.timeout, "timeout", "t", 10, "Specify a shutdown timeout in seconds")
diff --git a/cmd/compose/top.go b/cmd/compose/top.go
index 60f3a1fac8a..70c3f01757f 100644
--- a/cmd/compose/top.go
+++ b/cmd/compose/top.go
@@ -44,7 +44,7 @@ func topCommand(p *projectOptions, backend api.Service) *cobra.Command {
 		RunE: Adapt(func(ctx context.Context, args []string) error {
 			return runTop(ctx, backend, opts, args)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	return topCmd
 }
diff --git a/cmd/compose/up.go b/cmd/compose/up.go
index 9e7e96c6f6e..6a2c34bb85f 100644
--- a/cmd/compose/up.go
+++ b/cmd/compose/up.go
@@ -109,7 +109,7 @@ func upCommand(p *projectOptions, backend api.Service) *cobra.Command {
 			}
 			return runUp(ctx, backend, create, up, project, services)
 		}),
-		ValidArgsFunction: serviceCompletion(p),
+		ValidArgsFunction: completeServiceNames(p),
 	}
 	flags := upCmd.Flags()
 	flags.BoolVarP(&up.Detach, "detach", "d", false, "Detached mode: Run containers in the background")
diff --git a/cmd/main.go b/cmd/main.go
index 2325d975e1e..0f4ec1e13b2 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -59,6 +59,7 @@ func pluginMain() {
 			SchemaVersion: "0.1.0",
 			Vendor:        "Docker Inc.",
 			Version:       internal.Version,
+			Completion:    true,
 		})
 }
 
diff --git a/go.mod b/go.mod
index 7f2408a27a4..b342f7822a6 100644
--- a/go.mod
+++ b/go.mod
@@ -133,7 +133,7 @@ require (
 )
 
 replace (
-	github.com/docker/cli => github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible
+	github.com/docker/cli => github.com/ndeloof/cli v0.0.0-20220317134108-66942b8c2379
 	github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43+incompatible
 
 	// For k8s dependencies, we use a replace directive, to prevent them being
diff --git a/go.sum b/go.sum
index 287e1ee731c..c6e875aed9e 100644
--- a/go.sum
+++ b/go.sum
@@ -472,8 +472,6 @@ github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e/go.mo
 github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
 github.com/docker/buildx v0.8.1 h1:XcVCxhDkUI8QvkBYAoCl3gcHUGFc03jZDzKdh8IJmPs=
 github.com/docker/buildx v0.8.1/go.mod h1:9v3laulRPwglXHuPulXa5onXQPlgrIq6LnCXc7SgHJw=
-github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible h1:RWXvuBczWuSIMjI69AnkNklNNVX2gmS0X+15AttGDVk=
-github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/cli-docs-tool v0.4.0 h1:MdfKoErGEbFqIxQ8an9BsZ+YzKUGd58RBVkV+Q82GPo=
 github.com/docker/cli-docs-tool v0.4.0/go.mod h1:rgW5KKdNpLMBIuH4WQ/1RNh38nH+/Ay5jgL4P0ZMPpY=
 github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
@@ -1086,6 +1084,8 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+
 github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
 github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
 github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
+github.com/ndeloof/cli v0.0.0-20220317134108-66942b8c2379 h1:h7rn7yyGFVWDV53V8VX99zvubpnD8i2+yw0rIWkHsi0=
+github.com/ndeloof/cli v0.0.0-20220317134108-66942b8c2379/go.mod h1:wxmb4t3v3ZwISBr3B/B631+3VJe+erAxkl3vXQwXj2c=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
 github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E=
 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
diff --git a/pkg/mocks/mock_docker_cli.go b/pkg/mocks/mock_docker_cli.go
index 5162883d5db..e783c055b78 100644
--- a/pkg/mocks/mock_docker_cli.go
+++ b/pkg/mocks/mock_docker_cli.go
@@ -91,20 +91,6 @@ func (mr *MockCliMockRecorder) Client() *gomock.Call {
 	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Client", reflect.TypeOf((*MockCli)(nil).Client))
 }
 
-// ClientInfo mocks base method.
-func (m *MockCli) ClientInfo() command.ClientInfo {
-	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "ClientInfo")
-	ret0, _ := ret[0].(command.ClientInfo)
-	return ret0
-}
-
-// ClientInfo indicates an expected call of ClientInfo.
-func (mr *MockCliMockRecorder) ClientInfo() *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientInfo", reflect.TypeOf((*MockCli)(nil).ClientInfo))
-}
-
 // ConfigFile mocks base method.
 func (m *MockCli) ConfigFile() *configfile.ConfigFile {
 	m.ctrl.T.Helper()
