diff --git a/cmd/get-main.go b/cmd/get-main.go index e21f0120..88c469f7 100644 --- a/cmd/get-main.go +++ b/cmd/get-main.go @@ -85,6 +85,7 @@ func mainGet(cliCtx *cli.Context) error { } else { pg = newAccounter(totalBytes) } + defer showLastProgressBar(pg) go func() { opts := prepareCopyURLsOpts{ sourceURLs: sourceURLs, diff --git a/cmd/put-main.go b/cmd/put-main.go index 8e3bce9e..f4cb75fa 100644 --- a/cmd/put-main.go +++ b/cmd/put-main.go @@ -121,6 +121,7 @@ func mainPut(cliCtx *cli.Context) error { } else { pg = newAccounter(totalBytes) } + defer showLastProgressBar(pg) go func() { opts := prepareCopyURLsOpts{ sourceURLs: sourceURLs, @@ -173,3 +174,13 @@ func printPutURLsError(putURLs *URLs) { "Unable to upload.") } } + +func showLastProgressBar(pg ProgressReader) { + if progressReader, ok := pg.(*progressBar); ok { + progressReader.ProgressBar.Finish() + } else { + if accntReader, ok := pg.(*accounter); ok { + printMsg(accntReader.Stat()) + } + } +}