@cryptotaxi247 / kubo / commits / 218d52642

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

Matt Bell committed Nov 7, 2014 at 21:09 UTC 218d52642cd6962b09a48eb7aae184c851da89f2
2 files changed +16 -24
core/commands2/add.go
+4 -7
@@ -21,16 +21,13 @@ type AddOutput struct {
21
22 var addCmd = &cmds.Command{
23 Options: []cmds.Option{
24 - cmds.Option{[]string{"recursive", "r"}, cmds.Bool},
24 + cmds.Option{[]string{"recursive", "r"}, cmds.Bool, "Must be specified when adding directories"},
25 },
26 Arguments: []cmds.Argument{
27 - cmds.Argument{"file", cmds.ArgFile, false, true},
27 + cmds.Argument{"file", cmds.ArgFile, false, true, "The path to a file to be added to IPFS"},
28 },
29 - // TODO UsageLine: "add",
30 - // TODO Short: "Add an object to ipfs.",
31 - Help: `ipfs add <path>... - Add objects to ipfs.
32 -
33 - Adds contents of <path> to ipfs. Use -r to add directories.
29 + Description: "Add an object to ipfs.",
30 + Help: `Adds contents of <path> to ipfs. Use -r to add directories.
31 Note that directories are added recursively, to form the ipfs
32 MerkleDAG. A smarter partial add with a staging area (like git)
33 remains to be implemented.
core/commands2/block.go
+12 -17
@@ -22,14 +22,9 @@ type Block struct {
22 }
23
24 var blockCmd = &cmds.Command{
25 - Help: `ipfs block - manipulate raw ipfs blocks
26 -
27 - ipfs block get <key> - get and output block named by <key>
28 - ipfs block put - store stdin as a block, outputs <key>
29 -
30 -ipfs block is a plumbing command used to manipulate raw ipfs blocks.
31 -Reads from stdin or writes to stdout, and <key> is a base58 encoded
32 -multihash.`,
25 + Description: "Manipulate raw IPFS blocks",
26 + Help: `'ipfs block' is a plumbing command used to manipulate raw ipfs blocks.
27 +Reads from stdin or writes to stdout.`,
28 Subcommands: map[string]*cmds.Command{
29 "get": blockGetCmd,
30 "put": blockPutCmd,
@@ -37,13 +32,12 @@ multihash.`,
32 }
33
34 var blockGetCmd = &cmds.Command{
35 + Description: "Get a raw IPFS block",
36 + Help: `'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`,
37 +
38 Arguments: []cmds.Argument{
41 - cmds.Argument{"key", cmds.ArgString, true, false},
39 + cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"},
40 },
43 - Help: `ipfs get <key> - gets and outputs block named by <key>
44 -
45 -'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.
46 -<key> is a base58 encoded multihash`,
41 Run: func(res cmds.Response, req cmds.Request) {
42 n := req.Context().Node
43
@@ -77,12 +71,13 @@ var blockGetCmd = &cmds.Command{
71 }
72
73 var blockPutCmd = &cmds.Command{
74 + Description: "Stores input as an IPFS block",
75 + Help: `'ipfs block put' is a plumbing command for storing raw ipfs blocks.
76 +It outputs the key of the stored block.`,
77 +
78 Arguments: []cmds.Argument{
81 - cmds.Argument{"data", cmds.ArgFile, true, false},
79 + cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"},
80 },
83 - Help: `ipfs put - stores input as a block, outputs its key
84 -
85 -ipfs block put is a plumbing command for storing raw ipfs blocks.`,
81 Run: func(res cmds.Response, req cmds.Request) {
82 n := req.Context().Node
83