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
f6e88d74
Commit
f6e88d74
authored
May 09, 2016
by
Richard Littauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linted object diff help text
License: MIT Signed-off-by:
Richard Littauer
<
richard.littauer@gmail.com
>
parent
00f9ce6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
core/commands/object/diff.go
core/commands/object/diff.go
+19
-19
No files found.
core/commands/object/diff.go
View file @
f6e88d74
...
...
@@ -17,37 +17,37 @@ type Changes struct {
var
ObjectDiffCmd
=
&
cmds
.
Command
{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"
t
akes a diff of the two given objects"
,
Tagline
:
"
T
akes a diff of the two given objects
.
"
,
ShortDescription
:
`
ipfs object diff is a command used to show the differences between
'
ipfs object diff
'
is a command used to show the differences between
two ipfs objects.`
,
LongDescription
:
`
ipfs object diff is a command used to show the differences between
'
ipfs object diff
'
is a command used to show the differences between
two ipfs objects.
Example:
$
ls foo
>
ls foo
bar baz/ giraffe
$
ipfs add -r foo
>
ipfs add -r foo
...
a
dded QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz foo
$
OBJ_A=QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz
$
echo "different content" > foo/bar
$
ipfs add -r foo
A
dded QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz foo
>
OBJ_A=QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz
>
echo "different content" > foo/bar
>
ipfs add -r foo
...
a
dded QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD foo
$
OBJ_B=QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD
$
ipfs object diff -v $OBJ_A $OBJ_B
c
hanged "bar" from QmNgd5cz2jNftnAHBhcRUGdtiaMzb5Rhjqd4etondHHST8 to QmRfFVsjSXkhFxrfWnLpMae2M4GBVsry6VAuYYcji5MiZb
A
dded QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD foo
>
OBJ_B=QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD
>
ipfs object diff -v $OBJ_A $OBJ_B
C
hanged "bar" from QmNgd5cz2jNftnAHBhcRUGdtiaMzb5Rhjqd4etondHHST8 to QmRfFVsjSXkhFxrfWnLpMae2M4GBVsry6VAuYYcji5MiZb
.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"obj_a"
,
true
,
false
,
"
o
bject to diff against"
),
cmds
.
StringArg
(
"obj_b"
,
true
,
false
,
"
o
bject to diff"
),
cmds
.
StringArg
(
"obj_a"
,
true
,
false
,
"
O
bject to diff against
.
"
),
cmds
.
StringArg
(
"obj_b"
,
true
,
false
,
"
O
bject to diff
.
"
),
},
Options
:
[]
cmds
.
Option
{
cmds
.
BoolOption
(
"verbose"
,
"v"
,
"Produce verbose output"
),
cmds
.
BoolOption
(
"verbose"
,
"v"
,
"Produce verbose output
.
"
),
},
Run
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
node
,
err
:=
req
.
InvocContext
()
.
GetNode
()
...
...
@@ -103,11 +103,11 @@ Example:
if
verbose
{
switch
change
.
Type
{
case
dagutils
.
Add
:
fmt
.
Fprintf
(
buf
,
"
a
dded new link %q pointing to %s
\n
"
,
change
.
Path
,
change
.
After
)
fmt
.
Fprintf
(
buf
,
"
A
dded new link %q pointing to %s
.
\n
"
,
change
.
Path
,
change
.
After
)
case
dagutils
.
Mod
:
fmt
.
Fprintf
(
buf
,
"
c
hanged %q from %s to %s
\n
"
,
change
.
Path
,
change
.
Before
,
change
.
After
)
fmt
.
Fprintf
(
buf
,
"
C
hanged %q from %s to %s
.
\n
"
,
change
.
Path
,
change
.
Before
,
change
.
After
)
case
dagutils
.
Remove
:
fmt
.
Fprintf
(
buf
,
"
r
emoved link %q (was %s)
\n
"
,
change
.
Path
,
change
.
Before
)
fmt
.
Fprintf
(
buf
,
"
R
emoved link %q (was %s)
.
\n
"
,
change
.
Path
,
change
.
Before
)
}
}
else
{
switch
change
.
Type
{
...
...
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