diff options
author | Qi Wang <qiwan@redhat.com> | 2020-05-14 14:12:24 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2020-05-14 14:28:51 -0400 |
commit | 28ffe74e4441d96cb36abb58344824bfc4701c47 (patch) | |
tree | 72dfda68acbe15c07c91a856f83b327c45cc72da /cmd/podman/system/events.go | |
parent | 7e9ed37c0997d6dd2d6fc6ed6476039ee954286c (diff) | |
download | podman-28ffe74e4441d96cb36abb58344824bfc4701c47.tar.gz podman-28ffe74e4441d96cb36abb58344824bfc4701c47.tar.bz2 podman-28ffe74e4441d96cb36abb58344824bfc4701c47.zip |
fix bug --format {{json.}} of events
Allow the `podman events --format` accept {{json.}} and complete small fix podman-events.1.md
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman/system/events.go')
-rw-r--r-- | cmd/podman/system/events.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go index 6aae62dc0..27e80138e 100644 --- a/cmd/podman/system/events.go +++ b/cmd/podman/system/events.go @@ -5,6 +5,7 @@ import ( "context" "html/template" "os" + "strings" "github.com/containers/buildah/pkg/formats" "github.com/containers/libpod/cmd/podman/registry" @@ -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 { |