From 4588732af33e4fb119215ee3e9f7bee4fd1e896c Mon Sep 17 00:00:00 2001 From: Jeromy <jeromyj@gmail.com> Date: Mon, 17 Nov 2014 10:27:41 -0800 Subject: [PATCH] address comments from PR --- core/commands2/id.go | 16 ++++++++++------ core/commands2/root.go | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/commands2/id.go b/core/commands2/id.go index 88a602d8b..3a0bd6a77 100644 --- a/core/commands2/id.go +++ b/core/commands2/id.go @@ -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 @@ -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) { @@ -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 @@ -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 { diff --git a/core/commands2/root.go b/core/commands2/root.go index e84746253..5b91dcced 100644 --- a/core/commands2/root.go +++ b/core/commands2/root.go @@ -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 Advanced Commands: -- GitLab