display key if BlockPut is successful
Henry committed
Oct 14, 2014 at 00:39 UTC
a6630c804f5376b87bf0d773a66c3438d657cf18
1 file changed
+6
-3
core/commands/block.go
+6
-3
@@ -45,8 +45,11 @@ func BlockPut(n *core.IpfsNode, args []string, opts map[string]interface{}, out
45
b := blocks.NewBlock(data)
46
log.Debug("BlockPut key: '%q'", b.Key())
47
48
- _, err = n.Blocks.AddBlock(b)
49
- log.Debug("BlockPut Done. Err: %q", err)
48
+ k, err := n.Blocks.AddBlock(b)
49
+ if err != nil {
50
+ return err
51
+ }
52
+ fmt.Fprintf(out, "added as '%s'\n", k)
53
51
- return err
54
+ return nil
55
}