Skip to content

Commit

Permalink
address comments from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Nov 17, 2014
1 parent 9f4127a commit 4588732
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions core/commands2/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
u "github.com/jbenet/go-ipfs/util"
)

const offlineIdErrorMessage = `ID command fails when run without daemon, we are working
to fix this In the meantime, please run the daemon if you want to use 'ipfs id'`

type IdOutput struct {
ID string
PublicKey string
Expand All @@ -26,9 +29,11 @@ type IdOutput struct {

var idCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Show IPFS Node IF info",
ShortDescription: `Prints out information about the specified peer,
if no peer is specified, prints out local peers info.`,
Tagline: "Show IPFS Node ID info",
ShortDescription: `
Prints out information about the specified peer,
if no peer is specified, prints out local peers info.
`,
},
Arguments: nil,
Run: func(req cmds.Request) (interface{}, error) {
Expand All @@ -50,8 +55,7 @@ var idCmd = &cmds.Command{
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
p, err := node.Routing.FindPeer(ctx, id)
if err == kb.ErrLookupFailure {
return nil, errors.New(`ID command fails when run without daemon, we are working to fix this
In the meantime, please run the daemon if you want to use 'ipfs id'`)
return nil, errors.New(offlineIdErrorMessage)
}
if err != nil {
return nil, err
Expand Down Expand Up @@ -80,7 +84,7 @@ func printPeer(p peer.Peer) (interface{}, error) {
info.ID = p.ID().String()
if p.PubKey() == nil {
return nil, errors.New(`peer publickey not populated on offline runs,
please run the daemon to use ipfs id!`)
please run the daemon to use ipfs id!`)
}
pkb, err := p.PubKey().Bytes()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/commands2/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Tool commands:
update Download and apply go-ipfs updates
version Show ipfs version information
commands List all available commands
id Show info about ipfs peers
id Show info about ipfs peers

This comment has been minimized.

Copy link
@jbenet

jbenet Nov 17, 2014

Member

this seems to still be incorrectly indented. use spaces on both places. (show invisibles)

Advanced Commands:
Expand Down

0 comments on commit 4588732

Please sign in to comment.