size: include source in JSON output - fixes #5429
This commit is contained in:
committed by
Nick Craig-Wood
parent
cfdc9d0558
commit
35f052e29a
@@ -55,6 +55,7 @@ of the size command.`,
|
||||
Count int64 `json:"count"`
|
||||
Bytes int64 `json:"bytes"`
|
||||
Sizeless int64 `json:"sizeless"`
|
||||
Fs string `json:"fs"`
|
||||
}
|
||||
|
||||
results.Count, results.Bytes, results.Sizeless, err = operations.Count(context.Background(), fsrc)
|
||||
@@ -65,6 +66,7 @@ of the size command.`,
|
||||
fs.Logf(fsrc, "Size may be underestimated due to %d objects with unknown size", results.Sizeless)
|
||||
}
|
||||
if jsonOutput {
|
||||
results.Fs = args[0]
|
||||
return json.NewEncoder(os.Stdout).Encode(results)
|
||||
}
|
||||
count := strconv.FormatInt(results.Count, 10)
|
||||
|
||||
Reference in New Issue
Block a user