@@ -20,29 +20,8 @@ var ObjectPatchCmd = &cmds.Command{
20
20
Tagline : "Create a new merkledag object based on an existing one" ,
21
21
ShortDescription : `
22
22
'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.
46
25
` ,
47
26
},
48
27
Arguments : []cmds.Argument {},
@@ -67,7 +46,15 @@ var patchAppendDataCmd = &cmds.Command{
67
46
Helptext : cmds.HelpText {
68
47
Tagline : "Append data to the data segment of a dag node" ,
69
48
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
+ ` ,
71
58
},
72
59
Arguments : []cmds.Argument {
73
60
cmds .StringArg ("root" , true , false , "the hash of the node to modify" ),
@@ -162,7 +149,12 @@ var patchSetDataCmd = &cmds.Command{
162
149
}
163
150
164
151
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
+ },
166
158
Arguments : []cmds.Argument {
167
159
cmds .StringArg ("root" , true , false , "the hash of the node to modify" ),
168
160
cmds .StringArg ("link" , true , false , "name of the link to remove" ),
@@ -220,6 +212,8 @@ var patchAddLinkCmd = &cmds.Command{
220
212
Helptext : cmds.HelpText {
221
213
Tagline : "add a link to a given object" ,
222
214
ShortDescription : `
215
+ Add a merkle-link to the given object and return the hash of the result.
216
+
223
217
Examples:
224
218
225
219
EMPTY_DIR=$(ipfs object new unixfs-dir)
0 commit comments