diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index ec8025bc0..a5fbbf6d3 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -238,7 +238,7 @@ func identityConfig(nbits int) (config.Identity, error) { return ident, debugerror.New("Bitsize less than 1024 is considered unsafe.") } - fmt.Printf("generating key pair...") + fmt.Printf("generating %v-bit RSA keypair...", nbits) sk, pk, err := ci.GenerateKeyPair(ci.RSA, nbits) if err != nil { return ident, err diff --git a/commands/http/client.go b/commands/http/client.go index 6f4015a30..528dcf045 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -153,8 +153,14 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error outputType := reflect.TypeOf(req.Command().Type) for { - v := reflect.New(outputType).Interface() - err := dec.Decode(v) + var v interface{} + var err error + if outputType != nil { + v = reflect.New(outputType).Interface() + err = dec.Decode(v) + } else { + err = dec.Decode(&v) + } if err != nil && err != io.EOF { fmt.Println(err.Error()) return @@ -200,13 +206,20 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error } else { outputType := reflect.TypeOf(req.Command().Type) - v := reflect.New(outputType).Interface() - err = dec.Decode(v) + var v interface{} + + if outputType != nil { + v = reflect.New(outputType).Interface() + err = dec.Decode(v) + } else { + err = dec.Decode(&v) + } if err != nil && err != io.EOF { return nil, err } - - res.SetOutput(v) + if v != nil { + res.SetOutput(v) + } } return res, nil diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index a84682a8c..441a611a2 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -69,7 +69,7 @@ in the bootstrap list). }, Arguments: []cmds.Argument{ - cmds.StringArg("peer", false, true, peerOptionDesc), + cmds.StringArg("peer", false, true, peerOptionDesc).EnableStdin(), }, Options: []cmds.Option{ @@ -138,7 +138,7 @@ var bootstrapRemoveCmd = &cmds.Command{ }, Arguments: []cmds.Argument{ - cmds.StringArg("peer", false, true, peerOptionDesc), + cmds.StringArg("peer", false, true, peerOptionDesc).EnableStdin(), }, Options: []cmds.Option{ cmds.BoolOption("all", "Remove all bootstrap peers."), diff --git a/core/commands/root.go b/core/commands/root.go index 93929fc76..60fd0a93f 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -28,6 +28,7 @@ Basic commands: add Add an object to ipfs cat Show ipfs object data ls List links from an object + refs List hashes of links from an object Tool commands: @@ -36,14 +37,22 @@ Tool commands: version Show ipfs version information commands List all available commands id Show info about ipfs peers + pin Pin objects to local storage + name Publish or resolve IPNS names + log Change the logging level Advanced Commands: daemon Start a long-running daemon process mount Mount an ipfs read-only mountpoint - serve Serve an interface to ipfs diag Print diagnostics +Network commands: + + swarm Manage connections to the p2p network + bootstrap Add or remove bootstrap peers + ping Measure the latency of a connection + Plumbing commands: block Interact with raw blocks in the datastore diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 5e6995b83..29cd70063 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -36,7 +36,7 @@ test_expect_success "ipfs peer id looks good" ' test_expect_success "ipfs init output looks good" ' STARTHASH="QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB" && echo "initializing ipfs node at $IPFS_PATH" >expected && - echo "generating key pair...done" >>expected && + echo "generating 4096-bit RSA keypair...done" >>expected && echo "peer identity: $PEERID" >>expected && printf "\\n%s\\n" "to get started, enter: ipfs cat $STARTHASH" >>expected && test_cmp expected actual_init