mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 16:58:11 +08:00
core/commands2: Added descriptions for 'add', 'block'
This commit is contained in:
parent
351ed9589a
commit
218d52642c
@ -21,16 +21,13 @@ type AddOutput struct {
|
||||
|
||||
var addCmd = &cmds.Command{
|
||||
Options: []cmds.Option{
|
||||
cmds.Option{[]string{"recursive", "r"}, cmds.Bool},
|
||||
cmds.Option{[]string{"recursive", "r"}, cmds.Bool, "Must be specified when adding directories"},
|
||||
},
|
||||
Arguments: []cmds.Argument{
|
||||
cmds.Argument{"file", cmds.ArgFile, false, true},
|
||||
cmds.Argument{"file", cmds.ArgFile, false, true, "The path to a file to be added to IPFS"},
|
||||
},
|
||||
// TODO UsageLine: "add",
|
||||
// TODO Short: "Add an object to ipfs.",
|
||||
Help: `ipfs add <path>... - Add objects to ipfs.
|
||||
|
||||
Adds contents of <path> to ipfs. Use -r to add directories.
|
||||
Description: "Add an object to ipfs.",
|
||||
Help: `Adds contents of <path> to ipfs. Use -r to add directories.
|
||||
Note that directories are added recursively, to form the ipfs
|
||||
MerkleDAG. A smarter partial add with a staging area (like git)
|
||||
remains to be implemented.
|
||||
|
||||
@ -22,14 +22,9 @@ type Block struct {
|
||||
}
|
||||
|
||||
var blockCmd = &cmds.Command{
|
||||
Help: `ipfs block - manipulate raw ipfs blocks
|
||||
|
||||
ipfs block get <key> - get and output block named by <key>
|
||||
ipfs block put - store stdin as a block, outputs <key>
|
||||
|
||||
ipfs block is a plumbing command used to manipulate raw ipfs blocks.
|
||||
Reads from stdin or writes to stdout, and <key> is a base58 encoded
|
||||
multihash.`,
|
||||
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.`,
|
||||
Subcommands: map[string]*cmds.Command{
|
||||
"get": blockGetCmd,
|
||||
"put": blockPutCmd,
|
||||
@ -37,13 +32,12 @@ multihash.`,
|
||||
}
|
||||
|
||||
var blockGetCmd = &cmds.Command{
|
||||
Arguments: []cmds.Argument{
|
||||
cmds.Argument{"key", cmds.ArgString, true, false},
|
||||
},
|
||||
Help: `ipfs get <key> - gets and outputs block named by <key>
|
||||
Description: "Get a raw IPFS block",
|
||||
Help: `'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`,
|
||||
|
||||
'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.
|
||||
<key> is a base58 encoded multihash`,
|
||||
Arguments: []cmds.Argument{
|
||||
cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"},
|
||||
},
|
||||
Run: func(res cmds.Response, req cmds.Request) {
|
||||
n := req.Context().Node
|
||||
|
||||
@ -77,12 +71,13 @@ var blockGetCmd = &cmds.Command{
|
||||
}
|
||||
|
||||
var blockPutCmd = &cmds.Command{
|
||||
Arguments: []cmds.Argument{
|
||||
cmds.Argument{"data", cmds.ArgFile, true, false},
|
||||
},
|
||||
Help: `ipfs put - stores input as a block, outputs its key
|
||||
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.`,
|
||||
|
||||
ipfs block put is a plumbing command for storing raw ipfs blocks.`,
|
||||
Arguments: []cmds.Argument{
|
||||
cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"},
|
||||
},
|
||||
Run: func(res cmds.Response, req cmds.Request) {
|
||||
n := req.Context().Node
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user