aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorParker Van Roy <pvanroy@redhat.com>2020-10-08 14:55:44 -0400
committerParker Van Roy <pvanroy@redhat.com>2020-10-08 14:55:44 -0400
commitc254a73d63fe565665cf0f2b475e6fe9926c9e73 (patch)
treecab82d3dad1a4efdfb2c52f9bfee3536eb9edf74 /cmd
parent59b5f0ac32ddf615fada021bc62c823bb73233da (diff)
downloadpodman-c254a73d63fe565665cf0f2b475e6fe9926c9e73.tar.gz
podman-c254a73d63fe565665cf0f2b475e6fe9926c9e73.tar.bz2
podman-c254a73d63fe565665cf0f2b475e6fe9926c9e73.zip
--format updates for images/diff.go
Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
Diffstat (limited to 'cmd')
-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'")
}