From 524b536101757e039bafa6dae74e4b45f2a5bd1f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 28 Apr 2022 16:02:02 +0200 Subject: image --format: fix add completion for go template It used the wrong struct so not all fields were listed in the completion. Fixes podman images --format and podman image history --format Signed-off-by: Paul Holzinger --- cmd/podman/images/history.go | 2 +- cmd/podman/images/list.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go index 26a4b6c3b..e190941e7 100644 --- a/cmd/podman/images/history.go +++ b/cmd/podman/images/history.go @@ -69,7 +69,7 @@ func historyFlags(cmd *cobra.Command) { formatFlagName := "format" flags.StringVar(&opts.format, formatFlagName, "", "Change the output to JSON or a Go template") - _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(entities.ImageHistoryLayer{})) + _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&historyReporter{})) flags.BoolVarP(&opts.human, "human", "H", true, "Display sizes and dates in human readable format") flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate the output") diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 58fb3e919..81011f9b1 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -94,7 +94,7 @@ func imageListFlagSet(cmd *cobra.Command) { formatFlagName := "format" flags.StringVar(&listFlag.format, formatFlagName, "", "Change the output format to JSON or a Go template") - _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(entities.ImageSummary{})) + _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&imageReporter{})) flags.BoolVar(&listFlag.digests, "digests", false, "Show digests") flags.BoolVarP(&listFlag.noHeading, "noheading", "n", false, "Do not print column headings") -- cgit v1.2.3-54-g00ecf