1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

Add MaxStorage field to output of "repo stat".

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
This commit is contained in:
Kevin Atkinson
2017-05-10 23:41:35 -04:00
parent a6e96e6c99
commit 0f46a34f59
3 changed files with 23 additions and 2 deletions

View File

@ -189,6 +189,12 @@ Version string The repo version.
} else {
fmt.Fprintf(buf, "RepoSize \t %d\n", stat.RepoSize)
}
maxSizeInMiB := stat.StorageMax / (1024 * 1024)
if human && maxSizeInMiB > 0 {
fmt.Fprintf(buf, "StorageMax (MiB) \t %d\n", maxSizeInMiB)
} else {
fmt.Fprintf(buf, "StorageMax \t %d\n", stat.StorageMax)
}
fmt.Fprintf(buf, "RepoPath \t %s\n", stat.RepoPath)
fmt.Fprintf(buf, "Version \t %s\n", stat.Version)