summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-22 09:56:28 -0400
committerGitHub <noreply@github.com>2021-04-22 09:56:28 -0400
commit8465626e312a582e434851e6e562974cb3e2e1f8 (patch)
treeca23028eb88c943b22b3d6a970421dc23592ec29 /cmd/podman/images
parent21c77846e4b441d1da4a27a416c2f4dcd8e68cff (diff)
parentd81021ed265e3cdfe32cdd0082b139f796ff5bfa (diff)
downloadpodman-8465626e312a582e434851e6e562974cb3e2e1f8.tar.gz
podman-8465626e312a582e434851e6e562974cb3e2e1f8.tar.bz2
podman-8465626e312a582e434851e6e562974cb3e2e1f8.zip
Merge pull request #10099 from Luap99/format-completion
Add go template shell completion for --format
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/diff.go2
-rw-r--r--cmd/podman/images/history.go2
-rw-r--r--cmd/podman/images/inspect.go3
-rw-r--r--cmd/podman/images/list.go2
-rw-r--r--cmd/podman/images/mount.go2
5 files changed, 6 insertions, 5 deletions
diff --git a/cmd/podman/images/diff.go b/cmd/podman/images/diff.go
index 36b0d4e7a..7f4c3e83d 100644
--- a/cmd/podman/images/diff.go
+++ b/cmd/podman/images/diff.go
@@ -41,7 +41,7 @@ func diffFlags(flags *pflag.FlagSet) {
formatFlagName := "format"
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format")
- _ = diffCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteJSONFormat)
+ _ = diffCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
}
func diff(cmd *cobra.Command, args []string) error {
diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go
index eaf56651f..16be0bb19 100644
--- a/cmd/podman/images/history.go
+++ b/cmd/podman/images/history.go
@@ -74,7 +74,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.AutocompleteJSONFormat)
+ _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(entities.ImageHistoryLayer{}))
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 fb96286fa..ac3becaa6 100644
--- a/cmd/podman/images/inspect.go
+++ b/cmd/podman/images/inspect.go
@@ -5,6 +5,7 @@ import (
"github.com/containers/podman/v3/cmd/podman/inspect"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
+ inspectTypes "github.com/containers/podman/v3/pkg/inspect"
"github.com/spf13/cobra"
)
@@ -34,7 +35,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.AutocompleteJSONFormat)
+ _ = 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 7a9a8a804..132af858b 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -83,7 +83,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.AutocompleteJSONFormat)
+ _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(entities.ImageSummary{}))
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/mount.go b/cmd/podman/images/mount.go
index 79c97006d..a098aac63 100644
--- a/cmd/podman/images/mount.go
+++ b/cmd/podman/images/mount.go
@@ -51,7 +51,7 @@ func mountFlags(cmd *cobra.Command) {
formatFlagName := "format"
flags.StringVar(&mountOpts.Format, formatFlagName, "", "Print the mounted images in specified format (json)")
- _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteJSONFormat)
+ _ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
}
func init() {