Skip to content

Commit

Permalink
--format updates for images/diff.go
Browse files Browse the repository at this point in the history
Signed-off-by: Parker Van Roy <[email protected]>
  • Loading branch information
ParkerVR committed Oct 8, 2020
1 parent 59b5f0a commit c254a73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/podman/images/diff.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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'")
}
Expand Down

0 comments on commit c254a73

Please sign in to comment.