From 6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 28 Apr 2022 18:31:23 +0200 Subject: image search --format: add completion for go template podman image search accepts a go template, we can use the same shell completion logic which is used everywhere else in the code. Signed-off-by: Paul Holzinger --- cmd/podman/images/search.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go index 7f202cb6a..335ea2b5a 100644 --- a/cmd/podman/images/search.go +++ b/cmd/podman/images/search.go @@ -9,6 +9,7 @@ import ( "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/report" "github.com/containers/image/v5/types" + "github.com/containers/podman/v4/cmd/podman/common" "github.com/containers/podman/v4/cmd/podman/registry" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/pkg/errors" @@ -87,7 +88,7 @@ func searchFlags(cmd *cobra.Command) { formatFlagName := "format" flags.StringVar(&searchOptions.Format, formatFlagName, "", "Change the output format to JSON or a Go template") - _ = cmd.RegisterFlagCompletionFunc(formatFlagName, completion.AutocompleteNone) + _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&entities.ImageSearchReport{})) limitFlagName := "limit" flags.IntVar(&searchOptions.Limit, limitFlagName, 0, "Limit the number of results") -- cgit v1.2.3-54-g00ecf