summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-13 14:29:59 +0200
committerGitHub <noreply@github.com>2021-10-13 14:29:59 +0200
commite3cf9b685a0099d55cd4d8086757c78bd64e9371 (patch)
treec6a699c8ceda3adb553beb74c770973a8770933f /cmd/podman/images
parentf12dc28bbc12376783064c645093715ef6831bd1 (diff)
parent14bfee31f728c383f02be98a22e3528278d2feec (diff)
downloadpodman-e3cf9b685a0099d55cd4d8086757c78bd64e9371.tar.gz
podman-e3cf9b685a0099d55cd4d8086757c78bd64e9371.tar.bz2
podman-e3cf9b685a0099d55cd4d8086757c78bd64e9371.zip
Merge pull request #11892 from vrothberg/search
podman search: display only name and description by default
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/search.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go
index 42a998461..c9a4793aa 100644
--- a/cmd/podman/images/search.go
+++ b/cmd/podman/images/search.go
@@ -20,6 +20,7 @@ import (
type searchOptionsWrapper struct {
entities.ImageSearchOptions
// CLI only flags
+ Compatible bool // Docker compat
TLSVerifyCLI bool // Used to convert to an optional bool later
Format string // For go templating
}
@@ -92,6 +93,7 @@ func searchFlags(cmd *cobra.Command) {
_ = cmd.RegisterFlagCompletionFunc(limitFlagName, completion.AutocompleteNone)
flags.Bool("no-trunc", true, "Do not truncate the output. Default: true")
+ flags.BoolVar(&searchOptions.Compatible, "compatible", false, "List stars, official and automated columns (Docker compatibility)")
authfileFlagName := "authfile"
flags.StringVar(&searchOptions.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override")
@@ -166,7 +168,11 @@ func imageSearch(cmd *cobra.Command, args []string) error {
renderHeaders = report.HasTable(searchOptions.Format)
row = report.NormalizeFormat(searchOptions.Format)
default:
- row = "{{.Index}}\t{{.Name}}\t{{.Description}}\t{{.Stars}}\t{{.Official}}\t{{.Automated}}\n"
+ row = "{{.Name}}\t{{.Description}}"
+ if searchOptions.Compatible {
+ row += "\t{{.Stars}}\t{{.Official}}\t{{.Automated}}"
+ }
+ row += "\n"
}
format := report.EnforceRange(row)