Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d729462

Browse files
committedJan 3, 2016
better doc strings
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent 6457c36 commit d729462

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed
 

‎core/commands/object/patch.go

+19-25
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,8 @@ var ObjectPatchCmd = &cmds.Command{
2020
Tagline: "Create a new merkledag object based on an existing one",
2121
ShortDescription: `
2222
'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
23-
build custom DAG objects. It adds and removes links from objects, creating a new
24-
object as a result. This is the merkle-dag version of modifying an object. It
25-
can also set the data inside a node with 'set-data' and append to that data as
26-
well with 'append-data'.
27-
28-
Patch commands:
29-
add-link <name> <ref> - adds a link to a node
30-
rm-link <name> - removes a link from a node
31-
set-data - sets a nodes data from stdin
32-
append-data - appends to a nodes data from stdin
33-
34-
35-
36-
ipfs object patch $FOO_BAR rm-link foo
37-
38-
This removes the link named foo from the hash in $FOO_BAR and returns the
39-
resulting object hash.
40-
41-
The data inside the node can be modified as well:
42-
43-
ipfs object patch $FOO_BAR set-data < file.dat
44-
ipfs object patch $FOO_BAR append-data < file.dat
45-
23+
build custom DAG objects. It mutates objects, creating new objects as a
24+
result. This is the merkle-dag version of modifying an object.
4625
`,
4726
},
4827
Arguments: []cmds.Argument{},
@@ -67,7 +46,15 @@ var patchAppendDataCmd = &cmds.Command{
6746
Helptext: cmds.HelpText{
6847
Tagline: "Append data to the data segment of a dag node",
6948
ShortDescription: `
70-
`,
49+
Append data to what already exists in the data segment in the given object.
50+
51+
EXAMPLE:
52+
$ echo "hello" | ipfs object patch $HASH append-data
53+
54+
note: this does not append data to a 'file', it modifies the actual raw
55+
data within an object. Objects have a max size of 1MB and objects larger than
56+
the limit will not be respected by the network.
57+
`,
7158
},
7259
Arguments: []cmds.Argument{
7360
cmds.StringArg("root", true, false, "the hash of the node to modify"),
@@ -162,7 +149,12 @@ var patchSetDataCmd = &cmds.Command{
162149
}
163150

164151
var patchRmLinkCmd = &cmds.Command{
165-
Helptext: cmds.HelpText{},
152+
Helptext: cmds.HelpText{
153+
Tagline: "remove a link from an object",
154+
ShortDescription: `
155+
removes a link by the given name from root.
156+
`,
157+
},
166158
Arguments: []cmds.Argument{
167159
cmds.StringArg("root", true, false, "the hash of the node to modify"),
168160
cmds.StringArg("link", true, false, "name of the link to remove"),
@@ -220,6 +212,8 @@ var patchAddLinkCmd = &cmds.Command{
220212
Helptext: cmds.HelpText{
221213
Tagline: "add a link to a given object",
222214
ShortDescription: `
215+
Add a merkle-link to the given object and return the hash of the result.
216+
223217
Examples:
224218
225219
EMPTY_DIR=$(ipfs object new unixfs-dir)

0 commit comments

Comments
 (0)
Please sign in to comment.