Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
4dca1f24
Commit
4dca1f24
authored
Jan 03, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better doc strings
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
d4ffc945
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
25 deletions
+19
-25
core/commands/object/patch.go
core/commands/object/patch.go
+19
-25
No files found.
core/commands/object/patch.go
View file @
4dca1f24
...
...
@@ -20,29 +20,8 @@ var ObjectPatchCmd = &cmds.Command{
Tagline
:
"Create a new merkledag object based on an existing one"
,
ShortDescription
:
`
'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
build custom DAG objects. It adds and removes links from objects, creating a new
object as a result. This is the merkle-dag version of modifying an object. It
can also set the data inside a node with 'set-data' and append to that data as
well with 'append-data'.
Patch commands:
add-link <name> <ref> - adds a link to a node
rm-link <name> - removes a link from a node
set-data - sets a nodes data from stdin
append-data - appends to a nodes data from stdin
ipfs object patch $FOO_BAR rm-link foo
This removes the link named foo from the hash in $FOO_BAR and returns the
resulting object hash.
The data inside the node can be modified as well:
ipfs object patch $FOO_BAR set-data < file.dat
ipfs object patch $FOO_BAR append-data < file.dat
build custom DAG objects. It mutates objects, creating new objects as a
result. This is the merkle-dag version of modifying an object.
`
,
},
Arguments
:
[]
cmds
.
Argument
{},
...
...
@@ -67,7 +46,15 @@ var patchAppendDataCmd = &cmds.Command{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"Append data to the data segment of a dag node"
,
ShortDescription
:
`
`
,
Append data to what already exists in the data segment in the given object.
EXAMPLE:
$ echo "hello" | ipfs object patch $HASH append-data
note: this does not append data to a 'file', it modifies the actual raw
data within an object. Objects have a max size of 1MB and objects larger than
the limit will not be respected by the network.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
...
...
@@ -162,7 +149,12 @@ var patchSetDataCmd = &cmds.Command{
}
var
patchRmLinkCmd
=
&
cmds
.
Command
{
Helptext
:
cmds
.
HelpText
{},
Helptext
:
cmds
.
HelpText
{
Tagline
:
"remove a link from an object"
,
ShortDescription
:
`
removes a link by the given name from root.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
cmds
.
StringArg
(
"link"
,
true
,
false
,
"name of the link to remove"
),
...
...
@@ -220,6 +212,8 @@ var patchAddLinkCmd = &cmds.Command{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"add a link to a given object"
,
ShortDescription
:
`
Add a merkle-link to the given object and return the hash of the result.
Examples:
EMPTY_DIR=$(ipfs object new unixfs-dir)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment