summaryrefslogtreecommitdiff
path: root/cmd/podman/system
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-07-31 00:22:32 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-07-31 01:40:42 +0800
commitb4fa2c2517fd313bb0000f7697274d2ab2498265 (patch)
tree33e8ed413795ab584b2559cccb353a58d8855d6d /cmd/podman/system
parent05b3e0e16bbbfede19bc5d817c62598e1ac6fa70 (diff)
downloadpodman-b4fa2c2517fd313bb0000f7697274d2ab2498265.tar.gz
podman-b4fa2c2517fd313bb0000f7697274d2ab2498265.tar.bz2
podman-b4fa2c2517fd313bb0000f7697274d2ab2498265.zip
fix podman system df format error
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'cmd/podman/system')
-rw-r--r--cmd/podman/system/df.go9
1 files changed, 9 insertions, 0 deletions
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
}