mirror of
https://github.com/rclone/rclone.git
synced 2024-11-21 16:03:29 +01:00
size: dont show duplicate object count when less than 1k
This commit is contained in:
parent
acf1e2df84
commit
e1b0417c28
@ -6,6 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs"
|
||||
@ -69,7 +70,13 @@ of the size command.
|
||||
if jsonOutput {
|
||||
return json.NewEncoder(os.Stdout).Encode(results)
|
||||
}
|
||||
fmt.Printf("Total objects: %s (%d)\n", fs.CountSuffix(results.Count), results.Count)
|
||||
count := strconv.FormatInt(results.Count, 10)
|
||||
countSuffix := fs.CountSuffix(results.Count).String()
|
||||
if count == countSuffix {
|
||||
fmt.Printf("Total objects: %s\n", count)
|
||||
} else {
|
||||
fmt.Printf("Total objects: %s (%s)\n", countSuffix, count)
|
||||
}
|
||||
fmt.Printf("Total size: %s (%d Byte)\n", fs.SizeSuffix(results.Bytes).ByteUnit(), results.Bytes)
|
||||
if results.Sizeless > 0 {
|
||||
fmt.Printf("Total objects with unknown size: %s (%d)\n", fs.CountSuffix(results.Sizeless), results.Sizeless)
|
||||
|
Loading…
Reference in New Issue
Block a user