aboutsummaryrefslogtreecommitdiffstats
path: root/drive/progress.go
diff options
context:
space:
mode:
Diffstat (limited to 'drive/progress.go')
-rw-r--r--drive/progress.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/drive/progress.go b/drive/progress.go
index 9d4eb5a..989191e 100644
--- a/drive/progress.go
+++ b/drive/progress.go
@@ -12,7 +12,7 @@ const MaxRateInterval = time.Second * 3
func getProgressReader(r io.Reader, w io.Writer, size int64) io.Reader {
// Don't wrap reader if output is discarded or size is too small
- if w == ioutil.Discard || size < 1024 * 1024 {
+ if w == ioutil.Discard || (size > 0 && size < 1024 * 1024) {
return r
}
@@ -79,7 +79,12 @@ func (self *Progress) draw(isLast bool) {
self.clear()
// Print progress
- fmt.Fprintf(self.Writer, "%s/%s", formatSize(self.progress, false), formatSize(self.Size, false))
+ fmt.Fprintf(self.Writer, "%s", formatSize(self.progress, false))
+
+ // Print total size
+ if self.Size > 0 {
+ fmt.Fprintf(self.Writer, "/%s", formatSize(self.Size, false))
+ }
// Print rate
if self.rate > 0 {