diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/images/trust_show.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cmd/podman/images/trust_show.go b/cmd/podman/images/trust_show.go index bcb60e2b3..40c077d67 100644 --- a/cmd/podman/images/trust_show.go +++ b/cmd/podman/images/trust_show.go @@ -12,6 +12,7 @@ import ( ) var ( + noHeading bool showTrustDescription = "Display trust policy for the system" showTrustCommand = &cobra.Command{ Annotations: map[string]string{registry.EngineMode: registry.ABIMode}, @@ -40,6 +41,7 @@ func init() { showFlags.BoolVar(&showTrustOptions.Raw, "raw", false, "Output raw policy file") _ = showFlags.MarkHidden("policypath") showFlags.StringVar(&showTrustOptions.RegistryPath, "registrypath", "", "") + showFlags.BoolVarP(&noHeading, "noheading", "n", false, "Do not print column headings") _ = showFlags.MarkHidden("registrypath") } @@ -64,10 +66,22 @@ func showTrust(cmd *cobra.Command, args []string) error { rpt := report.New(os.Stdout, cmd.Name()) defer rpt.Flush() + hdrs := report.Headers(imageReporter{}, map[string]string{ + "Transport": "Transport", + "RepoName": "Name", + "Type": "Type", + "GPGId": "Id", + "SignatureStore": "Store", + }) rpt, err = rpt.Parse(report.OriginPodman, - "{{range . }}{{.RepoName}}\t{{.Type}}\t{{.GPGId}}\t{{.SignatureStore}}\n{{end -}}") + "{{range . }}{{.Transport}}\t{{.RepoName}}\t{{.Type}}\t{{.GPGId}}\t{{.SignatureStore}}\n{{end -}}") if err != nil { return err } + if !noHeading { + if err := rpt.Execute(hdrs); err != nil { + return err + } + } return rpt.Execute(trust.Policies) } |