summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/ps.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-21 13:20:36 -0400
committerGitHub <noreply@github.com>2021-04-21 13:20:36 -0400
commit897f6c3a4a55bfc82a989c81cb3dc8998965c408 (patch)
tree2b257f4fbd123bdea9196af0e38b0ff77228be13 /cmd/podman/pods/ps.go
parent544c3156657e078cef297623842f79cb72dc32c6 (diff)
parent8ebeadc3c68d0291e9de6ce4b6fedf17f362129f (diff)
downloadpodman-897f6c3a4a55bfc82a989c81cb3dc8998965c408.tar.gz
podman-897f6c3a4a55bfc82a989c81cb3dc8998965c408.tar.bz2
podman-897f6c3a4a55bfc82a989c81cb3dc8998965c408.zip
Merge pull request #10088 from rhatdan/no-headers
Add --noheading flag to all list commands
Diffstat (limited to 'cmd/podman/pods/ps.go')
-rw-r--r--cmd/podman/pods/ps.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go
index aeba80525..a4b6d1afa 100644
--- a/cmd/podman/pods/ps.go
+++ b/cmd/podman/pods/ps.go
@@ -63,6 +63,7 @@ func init() {
flags.StringVar(&psInput.Format, formatFlagName, "", "Pretty-print pods to JSON or using a Go template")
_ = psCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteJSONFormat)
+ flags.Bool("noheading", false, "Do not print headers")
flags.BoolVar(&psInput.Namespace, "namespace", false, "Display namespace information of the pod")
flags.BoolVar(&psInput.Namespace, "ns", false, "Display namespace information of the pod")
flags.BoolVar(&noTrunc, "no-trunc", false, "Do not truncate pod and container IDs")
@@ -134,6 +135,10 @@ func pods(cmd *cobra.Command, _ []string) error {
renderHeaders = parse.HasTable(psInput.Format)
row = report.NormalizeFormat(psInput.Format)
}
+ noHeading, _ := cmd.Flags().GetBool("noheading")
+ if noHeading {
+ renderHeaders = false
+ }
format := parse.EnforceRange(row)
tmpl, err := template.New("listPods").Parse(format)