@cryptotaxi247 / kubo / commits / 234afc888

Adds repo version info to repo stat command

addresses #2571 License: MIT Signed-off-by: Mike Pfister <pfista@gmail.com>

Michael Pfister committed Apr 20, 2016 at 19:11 UTC 234afc8888d8d7b134c5d2b2094f68f57051ef0e
2 files changed +4
core/commands/repo.go
+2
@@ -109,6 +109,7 @@ set of stored objects and print repo statistics. It outputs to stdout:
109 NumObjects int Number of objects in the local repo.
110 RepoPath string The path to the repo being currently used.
111 RepoSize int Size in bytes that the repo is currently taking.
112 +Version string The repo version
113 `,
114 },
115 Run: func(req cmds.Request, res cmds.Response) {
@@ -151,6 +152,7 @@ RepoSize int Size in bytes that the repo is currently taking.
152 fmt.Fprintf(buf, "RepoSize \t %d\n", stat.RepoSize)
153 }
154 fmt.Fprintf(buf, "RepoPath \t %s\n", stat.RepoPath)
155 + fmt.Fprintf(buf, "Version \t %s\n", stat.Version)
156
157 return buf, nil
158 },
core/corerepo/stat.go
+2
@@ -10,6 +10,7 @@ type Stat struct {
10 NumObjects uint64
11 RepoSize uint64 // size in bytes
12 RepoPath string
13 + Version string
14 }
15
16 func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) {
@@ -39,5 +40,6 @@ func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) {
40 NumObjects: count,
41 RepoSize: usage,
42 RepoPath: path,
43 + Version: "fs-repo@" + fsrepo.RepoVersion,
44 }, nil
45 }