From b158181a1d500633a0d8ecdf0061e2ed699bf6ed Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 3 Feb 2024 17:56:06 +0100 Subject: [PATCH] cli/command/images: runImages: use proper camel-case for dockerCLI Signed-off-by: Sebastiaan van Stijn --- cli/command/image/list.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/command/image/list.go b/cli/command/image/list.go index b0df7aa2a1..a52db38261 100644 --- a/cli/command/image/list.go +++ b/cli/command/image/list.go @@ -24,7 +24,7 @@ type imagesOptions struct { } // NewImagesCommand creates a new `docker images` command -func NewImagesCommand(dockerCli command.Cli) *cobra.Command { +func NewImagesCommand(dockerCLI command.Cli) *cobra.Command { options := imagesOptions{filter: opts.NewFilterOpt()} cmd := &cobra.Command{ @@ -35,7 +35,7 @@ func NewImagesCommand(dockerCli command.Cli) *cobra.Command { if len(args) > 0 { options.matchName = args[0] } - return runImages(cmd.Context(), dockerCli, options) + return runImages(cmd.Context(), dockerCLI, options) }, Annotations: map[string]string{ "category-top": "7", @@ -55,20 +55,20 @@ func NewImagesCommand(dockerCli command.Cli) *cobra.Command { return cmd } -func newListCommand(dockerCli command.Cli) *cobra.Command { - cmd := *NewImagesCommand(dockerCli) +func newListCommand(dockerCLI command.Cli) *cobra.Command { + cmd := *NewImagesCommand(dockerCLI) cmd.Aliases = []string{"list"} cmd.Use = "ls [OPTIONS] [REPOSITORY[:TAG]]" return &cmd } -func runImages(ctx context.Context, dockerCli command.Cli, options imagesOptions) error { +func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions) error { filters := options.filter.Value() if options.matchName != "" { filters.Add("reference", options.matchName) } - images, err := dockerCli.Client().ImageList(ctx, image.ListOptions{ + images, err := dockerCLI.Client().ImageList(ctx, image.ListOptions{ All: options.all, Filters: filters, }) @@ -78,8 +78,8 @@ func runImages(ctx context.Context, dockerCli command.Cli, options imagesOptions format := options.format if len(format) == 0 { - if len(dockerCli.ConfigFile().ImagesFormat) > 0 && !options.quiet { - format = dockerCli.ConfigFile().ImagesFormat + if len(dockerCLI.ConfigFile().ImagesFormat) > 0 && !options.quiet { + format = dockerCLI.ConfigFile().ImagesFormat } else { format = formatter.TableFormatKey } @@ -87,7 +87,7 @@ func runImages(ctx context.Context, dockerCli command.Cli, options imagesOptions imageCtx := formatter.ImageContext{ Context: formatter.Context{ - Output: dockerCli.Out(), + Output: dockerCLI.Out(), Format: formatter.NewImageFormat(format, options.quiet, options.showDigests), Trunc: !options.noTrunc, },