summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-12-26 17:45:55 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-12-26 17:45:55 -0500
commit25860df8785c6d51ced8320ec6d0d9620171bdb9 (patch)
tree5dd5aa1f2d1ac038d28ad6261640436c1e461462 /cmd/podman/ps.go
parentc759c3f78dcbbf5dec462a863ad25cd41a1707b7 (diff)
downloadpodman-25860df8785c6d51ced8320ec6d0d9620171bdb9.tar.gz
podman-25860df8785c6d51ced8320ec6d0d9620171bdb9.tar.bz2
podman-25860df8785c6d51ced8320ec6d0d9620171bdb9.zip
The --quiet flag does not conflict with templates in ps
To match Docker behavior, make `--quiet` and `--format` with a Go template not conflict. Instead, just turn off `--quiet` in such cases, as we'll be using Go template output instead. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 9fad0ea65..4ac779430 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -204,11 +204,15 @@ func checkFlagsPassed(c *cliconfig.PsValues) error {
if c.Last >= 0 && c.Latest {
return errors.Errorf("last and latest are mutually exclusive")
}
- // Quiet conflicts with size, namespace, and format with a Go template
+ // Quiet conflicts with size and namespace and is overridden by a Go
+ // template.
if c.Quiet {
- if c.Size || c.Namespace || (c.Flag("format").Changed &&
- c.Format != formats.JSONString) {
- return errors.Errorf("quiet conflicts with size, namespace, and format with go template")
+ if c.Size || c.Namespace {
+ return errors.Errorf("quiet conflicts with size and namespace")
+ }
+ if c.Flag("format").Changed && c.Format != formats.JSONString {
+ // Quiet is overridden by Go template output.
+ c.Quiet = false
}
}
// Size and namespace conflict with each other