From 937b4e65eaf64ed18dc20150046f90f2503cbbfd Mon Sep 17 00:00:00 2001 From: eric wu Date: Fri, 5 Apr 2019 01:02:34 +0800 Subject: [PATCH] align object stat output --- core/commands/object/object.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/commands/object/object.go b/core/commands/object/object.go index b97c869a61d..76dc912918d 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -347,8 +347,10 @@ var ObjectStatCmd = &cmds.Command{ Type: ipld.NodeStat{}, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *ipld.NodeStat) error { + wtr := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) + defer wtr.Flush() fw := func(s string, n int) { - fmt.Fprintf(w, "%s: %d\n", s, n) + fmt.Fprintf(wtr, "%s:\t%d\n", s, n) } fw("NumLinks", out.NumLinks) fw("BlockSize", out.BlockSize)