From 6aa8d14745dd778211fcf2941ce8fe5b5a95d5d9 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 18 Mar 2019 09:37:01 -0500 Subject: support GO template {{ json . }} for podman version, we now support a GO template for json output. fixes #2671 Signed-off-by: baude --- cmd/podman/version.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/version.go b/cmd/podman/version.go index 336be892e..31b0b8e82 100644 --- a/cmd/podman/version.go +++ b/cmd/podman/version.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "strings" "text/tabwriter" "time" @@ -43,6 +44,9 @@ func versionCmd(c *cliconfig.VersionValues) error { versionOutputFormat := c.Format if versionOutputFormat != "" { + if strings.Join(strings.Fields(versionOutputFormat), "") == "{{json.}}" { + versionOutputFormat = formats.JSONString + } var out formats.Writer switch versionOutputFormat { case formats.JSONString: -- cgit v1.2.3-54-g00ecf