From da20887e7641c521aadb977bd0b73e9bb08e7a11 Mon Sep 17 00:00:00 2001
From: Juan Batiz-Benet <juan@benet.ai>
Date: Sat, 20 Sep 2014 07:24:49 -0700
Subject: [PATCH] ipfs add should output hash to user

for now, ipfs add output format:

    added <hash> <path>
    ...

(these commands will adhere to strict formats.)
---
 core/commands/add.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/commands/add.go b/core/commands/add.go
index f6bcc235..59c1385b 100644
--- a/core/commands/add.go
+++ b/core/commands/add.go
@@ -99,7 +99,12 @@ func addNode(n *core.IpfsNode, nd *dag.Node, fpath string) error {
 		return err
 	}
 
-	u.POut("added %s\n", fpath)
+	k, err := nd.Key()
+	if err != nil {
+		return err
+	}
+
+	u.POut("added %s %s\n", k.Pretty(), fpath)
 
 	// ensure we keep it. atm no-op
 	return n.PinDagNode(nd)
-- 
GitLab