summaryrefslogtreecommitdiff
path: root/cmd/podman/system/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/system/events.go')
-rw-r--r--cmd/podman/system/events.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go
index 31dd9aa77..27e80138e 100644
--- a/cmd/podman/system/events.go
+++ b/cmd/podman/system/events.go
@@ -5,10 +5,11 @@ import (
"context"
"html/template"
"os"
+ "strings"
"github.com/containers/buildah/pkg/formats"
- "github.com/containers/libpod/cmd/podman/common"
"github.com/containers/libpod/cmd/podman/registry"
+ "github.com/containers/libpod/cmd/podman/validate"
"github.com/containers/libpod/libpod/events"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/pkg/errors"
@@ -19,7 +20,7 @@ var (
eventsDescription = "Monitor podman events"
eventsCommand = &cobra.Command{
Use: "events",
- Args: common.NoArgs,
+ Args: validate.NoArgs,
Short: "Show podman events",
Long: eventsDescription,
RunE: eventsCmd,
@@ -54,6 +55,9 @@ func eventsCmd(cmd *cobra.Command, args []string) error {
eventsError error
tmpl *template.Template
)
+ if strings.Join(strings.Fields(eventFormat), "") == "{{json.}}" {
+ eventFormat = formats.JSONString
+ }
if eventFormat != formats.JSONString {
tmpl, err = template.New("events").Parse(eventFormat)
if err != nil {