From c5caccba14c6ca6b1fa9d5624bdfccbbf70ca089 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet <juan@benet.ai> Date: Fri, 19 Jun 2015 04:47:52 -0700 Subject: [PATCH] ipfs id -f=<addrs> and \n \t - added <addrs> field to `ipfs id -f` - added \n and \t conversion in `ipfs id -f` License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai> --- core/commands/id.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/commands/id.go b/core/commands/id.go index ea5e4cd54..31af08067 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -46,6 +46,7 @@ ipfs id supports the format option for output with the following keys: <aver>: agent version <pver>: protocol version <pubkey>: public key +<addrs>: addresses (newline delimited) `, }, Arguments: []cmds.Argument{ @@ -119,6 +120,9 @@ ipfs id supports the format option for output with the following keys: output = strings.Replace(output, "<aver>", val.AgentVersion, -1) output = strings.Replace(output, "<pver>", val.ProtocolVersion, -1) output = strings.Replace(output, "<pubkey>", val.PublicKey, -1) + output = strings.Replace(output, "<addrs>", strings.Join(val.Addresses, "\n"), -1) + output = strings.Replace(output, "\\n", "\n", -1) + output = strings.Replace(output, "\\t", "\t", -1) return strings.NewReader(output), nil } else { -- GitLab