mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 22:49:13 +08:00
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>
This commit is contained in:
@ -46,6 +46,7 @@ ipfs id supports the format option for output with the following keys:
|
|||||||
<aver>: agent version
|
<aver>: agent version
|
||||||
<pver>: protocol version
|
<pver>: protocol version
|
||||||
<pubkey>: public key
|
<pubkey>: public key
|
||||||
|
<addrs>: addresses (newline delimited)
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
Arguments: []cmds.Argument{
|
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, "<aver>", val.AgentVersion, -1)
|
||||||
output = strings.Replace(output, "<pver>", val.ProtocolVersion, -1)
|
output = strings.Replace(output, "<pver>", val.ProtocolVersion, -1)
|
||||||
output = strings.Replace(output, "<pubkey>", val.PublicKey, -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
|
return strings.NewReader(output), nil
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user