address comments from PR
Jeromy committed
Nov 17, 2014 at 10:27 UTC
4588732af33e4fb119215ee3e9f7bee4fd1e896c
2 files changed
+11
-7
core/commands2/id.go
+10
-6
@@ -16,6 +16,9 @@ import (
16
u "github.com/jbenet/go-ipfs/util"
17
)
18
19
+const offlineIdErrorMessage = `ID command fails when run without daemon, we are working
20
+to fix this In the meantime, please run the daemon if you want to use 'ipfs id'`
21
+
22
type IdOutput struct {
23
ID string
24
PublicKey string
@@ -26,9 +29,11 @@ type IdOutput struct {
29
30
var idCmd = &cmds.Command{
31
Helptext: cmds.HelpText{
29
- Tagline: "Show IPFS Node IF info",
30
- ShortDescription: `Prints out information about the specified peer,
31
- if no peer is specified, prints out local peers info.`,
32
+ Tagline: "Show IPFS Node ID info",
33
+ ShortDescription: `
34
+Prints out information about the specified peer,
35
+if no peer is specified, prints out local peers info.
36
+`,
37
},
38
Arguments: nil,
39
Run: func(req cmds.Request) (interface{}, error) {
@@ -50,8 +55,7 @@ var idCmd = &cmds.Command{
55
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
56
p, err := node.Routing.FindPeer(ctx, id)
57
if err == kb.ErrLookupFailure {
53
- return nil, errors.New(`ID command fails when run without daemon, we are working to fix this
54
- In the meantime, please run the daemon if you want to use 'ipfs id'`)
58
+ return nil, errors.New(offlineIdErrorMessage)
59
}
60
if err != nil {
61
return nil, err
@@ -80,7 +84,7 @@ func printPeer(p peer.Peer) (interface{}, error) {
84
info.ID = p.ID().String()
85
if p.PubKey() == nil {
86
return nil, errors.New(`peer publickey not populated on offline runs,
83
- please run the daemon to use ipfs id!`)
87
+please run the daemon to use ipfs id!`)
88
}
89
pkb, err := p.PubKey().Bytes()
90
if err != nil {
core/commands2/root.go
+1
-1
@@ -32,7 +32,7 @@ Tool commands:
32
update Download and apply go-ipfs updates
33
version Show ipfs version information
34
commands List all available commands
35
- id Show info about ipfs peers
35
+ id Show info about ipfs peers
36
37
Advanced Commands:
38