From 2d756473f6c24d16f41ff5ed6393901f4f6ecbaf Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Sun, 9 Nov 2014 20:48:40 -0800 Subject: [PATCH] core/command2: Make help text match old commands --- core/commands2/block.go | 10 ++++++---- core/commands2/bootstrap.go | 2 +- core/commands2/cat.go | 2 +- core/commands2/ls.go | 5 ++++- core/commands2/pin.go | 6 +++--- core/commands2/publish.go | 3 ++- core/commands2/refs.go | 6 ++++-- core/commands2/resolve.go | 3 ++- core/commands2/version.go | 2 +- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/core/commands2/block.go b/core/commands2/block.go index 4e9df7e7d..3368eeaf7 100644 --- a/core/commands2/block.go +++ b/core/commands2/block.go @@ -24,7 +24,8 @@ type Block struct { var blockCmd = &cmds.Command{ Description: "Manipulate raw IPFS blocks", Help: `'ipfs block' is a plumbing command used to manipulate raw ipfs blocks. -Reads from stdin or writes to stdout.`, +Reads from stdin or writes to stdout, and is a base58 encoded +multihash.`, Subcommands: map[string]*cmds.Command{ "get": blockGetCmd, "put": blockPutCmd, @@ -33,7 +34,8 @@ Reads from stdin or writes to stdout.`, var blockGetCmd = &cmds.Command{ Description: "Get a raw IPFS block", - Help: `'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`, + Help: `ipfs block get is a plumbing command for retreiving raw ipfs blocks. +It outputs to stdout, and is a base58 encoded multihash.`, Arguments: []cmds.Argument{ cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"}, @@ -72,8 +74,8 @@ var blockGetCmd = &cmds.Command{ var blockPutCmd = &cmds.Command{ Description: "Stores input as an IPFS block", - Help: `'ipfs block put' is a plumbing command for storing raw ipfs blocks. -It outputs the key of the stored block.`, + Help: `ipfs block put is a plumbing command for storing raw ipfs blocks. +It reads from stdin, and is a base58 encoded multihash.`, Arguments: []cmds.Argument{ cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"}, diff --git a/core/commands2/bootstrap.go b/core/commands2/bootstrap.go index 26b15e809..99eac9228 100644 --- a/core/commands2/bootstrap.go +++ b/core/commands2/bootstrap.go @@ -120,7 +120,7 @@ var bootstrapRemoveCmd = &cmds.Command{ } var bootstrapListCmd = &cmds.Command{ - Description: "Lists peers in the bootstrap list", + Description: "Show peers in the bootstrap list", Help: `Peers are output in the format '/'. `, diff --git a/core/commands2/cat.go b/core/commands2/cat.go index b1c8ed336..25327e436 100644 --- a/core/commands2/cat.go +++ b/core/commands2/cat.go @@ -12,7 +12,7 @@ import ( var catCmd = &cmds.Command{ Description: "Show IPFS object data", Help: `Retrieves the object named by and outputs the data - it contains. +it contains. `, Arguments: []cmds.Argument{ diff --git a/core/commands2/ls.go b/core/commands2/ls.go index 071209437..506b898cf 100644 --- a/core/commands2/ls.go +++ b/core/commands2/ls.go @@ -25,7 +25,9 @@ type LsOutput struct { var lsCmd = &cmds.Command{ Description: "List links from an object.", Help: `Retrieves the object named by and displays the links -it contains. +it contains, with the following format: + + `, Arguments: []cmds.Argument{ @@ -70,6 +72,7 @@ it contains. }, Marshallers: map[cmds.EncodingType]cmds.Marshaller{ cmds.Text: func(res cmds.Response) ([]byte, error) { + // TODO: revert format to match old command s := "" output := res.Output().(*LsOutput).Objects diff --git a/core/commands2/pin.go b/core/commands2/pin.go index 7f8a34618..28d965539 100644 --- a/core/commands2/pin.go +++ b/core/commands2/pin.go @@ -20,8 +20,8 @@ var pinCmd = &cmds.Command{ var addPinCmd = &cmds.Command{ Description: "Pins objects to local storage", - Help: `Keeps the object(s) named by in local storage. If the object -isn't already being stored, IPFS retrieves it. + Help: `Retrieves the object named by and stores it locally +on disk. `, Arguments: []cmds.Argument{ @@ -57,7 +57,7 @@ isn't already being stored, IPFS retrieves it. var rmPinCmd = &cmds.Command{ Description: "Unpin an object from local storage", Help: `Removes the pin from the given object allowing it to be garbage - collected if needed. +collected if needed. `, Arguments: []cmds.Argument{ diff --git a/core/commands2/publish.go b/core/commands2/publish.go index 37ba749b9..04a5684a0 100644 --- a/core/commands2/publish.go +++ b/core/commands2/publish.go @@ -16,7 +16,8 @@ var errNotOnline = errors.New("This command must be run in online mode. Try runn var publishCmd = &cmds.Command{ Description: "Publish an object to IPNS", Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and -the private key enables publishing new (signed) values. +the private key enables publishing new (signed) values. In publish, the +default value of is your own identity public key. Examples: diff --git a/core/commands2/refs.go b/core/commands2/refs.go index f66746ff8..f4b34e9f1 100644 --- a/core/commands2/refs.go +++ b/core/commands2/refs.go @@ -18,9 +18,11 @@ type RefsOutput struct { var refsCmd = &cmds.Command{ Description: "Lists link hashes from an object", Help: `Retrieves the object named by and displays the link - hashes it contains, with the following format: +hashes it contains, with the following format: - `, + + +Note: list all refs recursively with -r.`, Arguments: []cmds.Argument{ cmds.Argument{"ipfs-path", cmds.ArgString, true, true, diff --git a/core/commands2/resolve.go b/core/commands2/resolve.go index ecb6e276e..f6bf8f5b8 100644 --- a/core/commands2/resolve.go +++ b/core/commands2/resolve.go @@ -14,7 +14,8 @@ type ResolveOutput struct { var resolveCmd = &cmds.Command{ Description: "Gets the value currently published at an IPNS name", Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and -the private key enables publishing new (signed) values. +the private key enables publishing new (signed) values. In resolve, the +default value of is your own identity public key. Examples: diff --git a/core/commands2/version.go b/core/commands2/version.go index 9d085dd61..22b7ceb9c 100644 --- a/core/commands2/version.go +++ b/core/commands2/version.go @@ -13,7 +13,7 @@ type VersionOutput struct { var versionCmd = &cmds.Command{ Description: "Outputs the current version of IPFS", - Help: `Returns the version number of IPFS. + Help: `Returns the version number of IPFS and exits. `, Options: []cmds.Option{