diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-04-28 18:31:23 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-04-28 18:33:23 +0200 |
commit | 6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c (patch) | |
tree | 4c7c72588442edd2dec09c017929adb865fed167 | |
parent | 0d9f190280f65a5441b113316304a740931e22d4 (diff) | |
download | podman-6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c.tar.gz podman-6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c.tar.bz2 podman-6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c.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") |