mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
--format updates for images/diff.go
Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
This commit is contained in:
@ -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'")
|
||||
}
|
||||
|
Reference in New Issue
Block a user