summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-28 14:25:43 -0400
committerGitHub <noreply@github.com>2022-04-28 14:25:43 -0400
commit2e9f792e378491acc3c04ba389ec7cf15bef471e (patch)
treec7c864d61471b2b3559132cb870b9efdfce3a9b3 /cmd/podman/images
parentb2725024f859193eef10d33837258b206aab8245 (diff)
parent6b7fd318bd541033ab36fb5c3b3d0bfe79fc4f8c (diff)
downloadpodman-2e9f792e378491acc3c04ba389ec7cf15bef471e.tar.gz
podman-2e9f792e378491acc3c04ba389ec7cf15bef471e.tar.bz2
podman-2e9f792e378491acc3c04ba389ec7cf15bef471e.zip
Merge pull request #14053 from Luap99/shell-format
shell completion --format: work with nil structs
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/history.go2
-rw-r--r--cmd/podman/images/inspect.go2
-rw-r--r--cmd/podman/images/list.go2
-rw-r--r--cmd/podman/images/search.go3
4 files changed, 5 insertions, 4 deletions
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/inspect.go b/cmd/podman/images/inspect.go
index b4a79bc96..22c404b3f 100644
--- a/cmd/podman/images/inspect.go
+++ b/cmd/podman/images/inspect.go
@@ -34,7 +34,7 @@ func init() {
formatFlagName := "format"
flags.StringVarP(&inspectOpts.Format, formatFlagName, "f", "json", "Format the output to a Go template or json")
- _ = inspectCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(inspectTypes.ImageData{}))
+ _ = inspectCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&inspectTypes.ImageData{}))
}
func inspectExec(cmd *cobra.Command, args []string) error {
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")
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")