diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-08 18:15:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 18:15:42 -0400 |
commit | 2587cba3899213356575f01cc0aa226c0209b8ae (patch) | |
tree | 2611761c10d0995c59f12ef7a25a9cb56764b46f /cmd | |
parent | 2a63795338e4ccd4066566ac46856f37587d9db2 (diff) | |
parent | c254a73d63fe565665cf0f2b475e6fe9926c9e73 (diff) | |
download | podman-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')
-rw-r--r-- | cmd/podman/images/diff.go | 9 |
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'") } |