Commit 218d5264 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

core/commands2: Added descriptions for 'add', 'block'

parent 351ed958
......@@ -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{
Description: "Get a raw IPFS block",
Help: `'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`,
Arguments: []cmds.Argument{
cmds.Argument{"key", cmds.ArgString, true, false},
cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"},
},
Help: `ipfs get <key> - gets and outputs block named by <key>
'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.
<key> is a base58 encoded multihash`,
Run: func(res cmds.Response, req cmds.Request) {
n := req.Context().Node
......@@ -77,12 +71,13 @@ 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.`,
Arguments: []cmds.Argument{
cmds.Argument{"data", cmds.ArgFile, true, false},
cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"},
},
Help: `ipfs put - stores input as a block, outputs its key
ipfs block put is a plumbing command for storing raw ipfs blocks.`,
Run: func(res cmds.Response, req cmds.Request) {
n := req.Context().Node
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment