summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-08 18:15:42 -0400
committerGitHub <noreply@github.com>2020-10-08 18:15:42 -0400
commit2587cba3899213356575f01cc0aa226c0209b8ae (patch)
tree2611761c10d0995c59f12ef7a25a9cb56764b46f /cmd/podman
parent2a63795338e4ccd4066566ac46856f37587d9db2 (diff)
parentc254a73d63fe565665cf0f2b475e6fe9926c9e73 (diff)
downloadpodman-2587cba3899213356575f01cc0aa226c0209b8ae.tar.gz
podman-2587cba3899213356575f01cc0aa226c0209b8ae.tar.bz2
podman-2587cba3899213356575f01cc0aa226c0209b8ae.zip
Merge pull request #7969 from ParkerVR/format-images/diff
--format updates for images/diff.go
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/images/diff.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/images/diff.go b/cmd/podman/images/diff.go
index 26147345e..05a05fa04 100644
--- a/cmd/podman/images/diff.go
+++ b/cmd/podman/images/diff.go
@@ -1,6 +1,7 @@
package images
import (
+ "github.com/containers/podman/v2/cmd/podman/parse"
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/cmd/podman/report"
"github.com/containers/podman/v2/pkg/domain/entities"
@@ -49,11 +50,11 @@ func diff(cmd *cobra.Command, args []string) error {
return err
}
- switch diffOpts.Format {
- case "":
- return report.ChangesToTable(results)
- case "json":
+ switch {
+ case parse.MatchesJSONFormat(diffOpts.Format):
return report.ChangesToJSON(results)
+ case diffOpts.Format == "":
+ return report.ChangesToTable(results)
default:
return errors.New("only supported value for '--format' is 'json'")
}