From b4fa2c2517fd313bb0000f7697274d2ab2498265 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Fri, 31 Jul 2020 00:22:32 +0800 Subject: fix podman system df format error Signed-off-by: zhangguanzhang --- cmd/podman/system/df.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/system/df.go b/cmd/podman/system/df.go index a320eb5c7..03991101e 100644 --- a/cmd/podman/system/df.go +++ b/cmd/podman/system/df.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "os" + "strconv" "strings" "text/tabwriter" "text/template" @@ -69,6 +70,14 @@ func printSummary(reports *entities.SystemDfReport, userFormat string) error { // Images if len(userFormat) > 0 { + if !strings.HasSuffix(userFormat, `\n`) { + userFormat += `\n` + } + // should be Unquoto from cmd line + userFormat, err := strconv.Unquote(`"` + userFormat + `"`) + if err != nil { + return err + } format = userFormat } -- cgit v1.2.3-54-g00ecf