@cryptotaxi247 / kubo / commits / 2492f0cb3

document the set-data and append-data commands in patch

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Sep 23, 2015 at 10:41 UTC 2492f0cb38ced0a32ac1ac8b0119162dbb8c928f
1 file changed +16 -2
core/commands/object.go
+16 -2
@@ -433,9 +433,17 @@ var objectPatchCmd = &cmds.Command{
433 Helptext: cmds.HelpText{
434 Tagline: "Create a new merkledag object based on an existing one",
435 ShortDescription: `
436 -'ipfs object patch <root> [add-link|rm-link] <args>' is a plumbing command used to
436 +'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
437 build custom DAG objects. It adds and removes links from objects, creating a new
438 -object as a result. This is the merkle-dag version of modifying an object.
438 +object as a result. This is the merkle-dag version of modifying an object. It
439 +can also set the data inside a node with 'set-data' and append to that data as
440 +well with 'append-data'.
441 +
442 +Patch commands:
443 + add-link <name> <ref> - adds a link to a node
444 + rm-link <name> - removes a link from a node
445 + set-data - sets a nodes data from stdin
446 + append-data - appends to a nodes data from stdin
447
448 Examples:
449
@@ -450,6 +458,12 @@ a file containing 'bar', and returns the hash of the new object.
458
459 This removes the link named foo from the hash in $FOO_BAR and returns the
460 resulting object hash.
461 +
462 +The data inside the node can be modified as well:
463 +
464 + ipfs object patch $FOO_BAR set-data < file.dat
465 + ipfs object patch $FOO_BAR append-data < file.dat
466 +
467 `,
468 },
469 Options: []cmds.Option{