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>
Juan Batiz-Benet committed
Jun 19, 2015 at 04:47 UTC
c5caccba14c6ca6b1fa9d5624bdfccbbf70ca089
1 file changed
+4
core/commands/id.go
+4
@@ -46,6 +46,7 @@ ipfs id supports the format option for output with the following keys:
46
<aver>: agent version
47
<pver>: protocol version
48
<pubkey>: public key
49
+<addrs>: addresses (newline delimited)
50
`,
51
},
52
Arguments: []cmds.Argument{
@@ -119,6 +120,9 @@ ipfs id supports the format option for output with the following keys:
120
output = strings.Replace(output, "<aver>", val.AgentVersion, -1)
121
output = strings.Replace(output, "<pver>", val.ProtocolVersion, -1)
122
output = strings.Replace(output, "<pubkey>", val.PublicKey, -1)
123
+ output = strings.Replace(output, "<addrs>", strings.Join(val.Addresses, "\n"), -1)
124
+ output = strings.Replace(output, "\\n", "\n", -1)
125
+ output = strings.Replace(output, "\\t", "\t", -1)
126
return strings.NewReader(output), nil
127
} else {
128