1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

core/command2: Make help text match old commands

This commit is contained in:
Matt Bell
2014-11-09 20:48:40 -08:00
committed by Juan Batiz-Benet
parent 3406ee0ef4
commit 2d756473f6
9 changed files with 24 additions and 15 deletions

View File

@ -24,7 +24,8 @@ type Block struct {
var blockCmd = &cmds.Command{ var blockCmd = &cmds.Command{
Description: "Manipulate raw IPFS blocks", Description: "Manipulate raw IPFS blocks",
Help: `'ipfs block' is a plumbing command used to 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 <key> is a base58 encoded
multihash.`,
Subcommands: map[string]*cmds.Command{ Subcommands: map[string]*cmds.Command{
"get": blockGetCmd, "get": blockGetCmd,
"put": blockPutCmd, "put": blockPutCmd,
@ -33,7 +34,8 @@ Reads from stdin or writes to stdout.`,
var blockGetCmd = &cmds.Command{ var blockGetCmd = &cmds.Command{
Description: "Get a raw IPFS block", 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 <key> is a base58 encoded multihash.`,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"}, 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{ var blockPutCmd = &cmds.Command{
Description: "Stores input as an IPFS block", Description: "Stores input as an IPFS block",
Help: `'ipfs block put' is a plumbing command for storing raw ipfs blocks. Help: `ipfs block put is a plumbing command for storing raw ipfs blocks.
It outputs the key of the stored block.`, It reads from stdin, and <key> is a base58 encoded multihash.`,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"}, cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"},

View File

@ -120,7 +120,7 @@ var bootstrapRemoveCmd = &cmds.Command{
} }
var bootstrapListCmd = &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 '<multiaddr>/<peerID>'. Help: `Peers are output in the format '<multiaddr>/<peerID>'.
`, `,

View File

@ -12,7 +12,7 @@ import (
var catCmd = &cmds.Command{ var catCmd = &cmds.Command{
Description: "Show IPFS object data", Description: "Show IPFS object data",
Help: `Retrieves the object named by <ipfs-path> and outputs the data Help: `Retrieves the object named by <ipfs-path> and outputs the data
it contains. it contains.
`, `,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{

View File

@ -25,7 +25,9 @@ type LsOutput struct {
var lsCmd = &cmds.Command{ var lsCmd = &cmds.Command{
Description: "List links from an object.", Description: "List links from an object.",
Help: `Retrieves the object named by <ipfs-path> and displays the links Help: `Retrieves the object named by <ipfs-path> and displays the links
it contains. it contains, with the following format:
<link base58 hash> <link size in bytes> <link name>
`, `,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
@ -70,6 +72,7 @@ it contains.
}, },
Marshallers: map[cmds.EncodingType]cmds.Marshaller{ Marshallers: map[cmds.EncodingType]cmds.Marshaller{
cmds.Text: func(res cmds.Response) ([]byte, error) { cmds.Text: func(res cmds.Response) ([]byte, error) {
// TODO: revert format to match old command
s := "" s := ""
output := res.Output().(*LsOutput).Objects output := res.Output().(*LsOutput).Objects

View File

@ -20,8 +20,8 @@ var pinCmd = &cmds.Command{
var addPinCmd = &cmds.Command{ var addPinCmd = &cmds.Command{
Description: "Pins objects to local storage", Description: "Pins objects to local storage",
Help: `Keeps the object(s) named by <ipfs-path> in local storage. If the object Help: `Retrieves the object named by <ipfs-path> and stores it locally
isn't already being stored, IPFS retrieves it. on disk.
`, `,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
@ -57,7 +57,7 @@ isn't already being stored, IPFS retrieves it.
var rmPinCmd = &cmds.Command{ var rmPinCmd = &cmds.Command{
Description: "Unpin an object from local storage", Description: "Unpin an object from local storage",
Help: `Removes the pin from the given object allowing it to be garbage Help: `Removes the pin from the given object allowing it to be garbage
collected if needed. collected if needed.
`, `,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{

View File

@ -16,7 +16,8 @@ var errNotOnline = errors.New("This command must be run in online mode. Try runn
var publishCmd = &cmds.Command{ var publishCmd = &cmds.Command{
Description: "Publish an object to IPNS", Description: "Publish an object to IPNS",
Help: `IPNS is a PKI namespace, where names are the hashes of public keys, and 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 <name> is your own identity public key.
Examples: Examples:

View File

@ -18,9 +18,11 @@ type RefsOutput struct {
var refsCmd = &cmds.Command{ var refsCmd = &cmds.Command{
Description: "Lists link hashes from an object", Description: "Lists link hashes from an object",
Help: `Retrieves the object named by <ipfs-path> and displays the link Help: `Retrieves the object named by <ipfs-path> and displays the link
hashes it contains, with the following format: hashes it contains, with the following format:
<link base58 hash>`, <link base58 hash>
Note: list all refs recursively with -r.`,
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.Argument{"ipfs-path", cmds.ArgString, true, true, cmds.Argument{"ipfs-path", cmds.ArgString, true, true,

View File

@ -14,7 +14,8 @@ type ResolveOutput struct {
var resolveCmd = &cmds.Command{ var resolveCmd = &cmds.Command{
Description: "Gets the value currently published at an IPNS name", 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 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 <name> is your own identity public key.
Examples: Examples:

View File

@ -13,7 +13,7 @@ type VersionOutput struct {
var versionCmd = &cmds.Command{ var versionCmd = &cmds.Command{
Description: "Outputs the current version of IPFS", 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{ Options: []cmds.Option{