Merge pull request #501 from abperiasamy/ls-humanize-size
Humanize ls size field
This commit is contained in:
+2
-2
@@ -33,7 +33,7 @@ func Comma(v int64) string {
|
||||
j--
|
||||
}
|
||||
parts[j] = strconv.Itoa(int(v))
|
||||
return sign + strings.Join(parts[j:], ",")
|
||||
return sign + strings.Join(parts[j:len(parts)], ",")
|
||||
}
|
||||
|
||||
// Commaf produces a string form of the given number in base 10 with
|
||||
@@ -97,5 +97,5 @@ func BigComma(b *big.Int) string {
|
||||
j--
|
||||
}
|
||||
parts[j] = strconv.Itoa(int(b.Int64()))
|
||||
return sign + strings.Join(parts[j:], ",")
|
||||
return sign + strings.Join(parts[j:len(parts)], ",")
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/cheggaaa/pb"
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/minio-io/cli"
|
||||
"github.com/minio-io/mc/pkg/client"
|
||||
"github.com/minio-io/mc/pkg/console"
|
||||
@@ -45,8 +45,8 @@ func printItems(v []*client.Item) {
|
||||
|
||||
// printItem prints item meta-data
|
||||
func printItem(date time.Time, v int64, name string) {
|
||||
fmt.Printf(console.Time("%s ", date.Local().Format(printDate)))
|
||||
fmt.Printf(console.Size("[%9s] ", pb.FormatBytes(v)))
|
||||
fmt.Printf(console.Time("[%s] ", date.Local().Format(printDate)))
|
||||
fmt.Printf(console.Size("%5s ", humanize.Bytes(uint64(v))))
|
||||
fmt.Println(console.File("%s", name))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user