From fcea632b3d5d93da257ccd282d93a70e269090db Mon Sep 17 00:00:00 2001 From: chenminjian <727180553@qq.com> Date: Tue, 6 Nov 2018 15:23:21 +0800 Subject: [PATCH] fix(cmd/add): progressbar output error when input is read from stdin License: MIT Signed-off-by: chenminjian <727180553@qq.com> --- core/commands/add.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/commands/add.go b/core/commands/add.go index 3b5272199..a6c809aa1 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -327,6 +327,14 @@ You can now check what blocks have been created by: return } } + + if progress && bar.Total == 0 && bar.Get() != 0 { + bar.Total = bar.Get() + bar.ShowPercent = true + bar.ShowBar = true + bar.ShowTimeLeft = true + bar.Update() + } } if e := res.Error(); e != nil {