mirror of
https://github.com/containers/podman
synced 2024-10-20 01:03:51 +00:00
Merge pull request #7969 from ParkerVR/format-images/diff
--format updates for images/diff.go
This commit is contained in:
commit
2587cba389
|
@ -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'")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue