diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-04-28 18:31:23 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-05-03 13:42:00 -0400 |
commit | 1d21204122178925a400b32e643047aa391082bb (patch) | |
tree | 87e1a48352257daa3f2579b1bf586917343c7081 | |
parent | d4fe645ed4f9af88d267b17b00cb717efc5880d2 (diff) | |
download | podman-1d21204122178925a400b32e643047aa391082bb.tar.gz podman-1d21204122178925a400b32e643047aa391082bb.tar.bz2 podman-1d21204122178925a400b32e643047aa391082bb.zip |
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 <pholzing@redhat.com>
-rw-r--r-- | cmd/podman/images/search.go | 3 |
1 files changed, 2 insertions, 1 deletions
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") |