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
7f807937
Commit
7f807937
authored
Jan 19, 2019
by
chenminjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refact(cmd/patch): change string to const
License: MIT Signed-off-by:
chenminjian
<
727180553@qq.com
>
parent
de0bbb00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
core/commands/object/patch.go
core/commands/object/patch.go
+6
-2
No files found.
core/commands/object/patch.go
View file @
7f807937
...
...
@@ -167,6 +167,10 @@ Remove a Merkle-link from the given object and return the hash of the result.
},
}
const
(
createOptionName
=
"create"
)
var
patchAddLinkCmd
=
&
cmds
.
Command
{
Helptext
:
cmdkit
.
HelpText
{
Tagline
:
"Add a link to a given object."
,
...
...
@@ -189,7 +193,7 @@ to a file containing 'bar', and returns the hash of the new object.
cmdkit
.
StringArg
(
"ref"
,
true
,
false
,
"IPFS object to add link to."
),
},
Options
:
[]
cmdkit
.
Option
{
cmdkit
.
BoolOption
(
"
create
"
,
"p"
,
"Create intermediary nodes."
),
cmdkit
.
BoolOption
(
create
OptionName
,
"p"
,
"Create intermediary nodes."
),
},
Run
:
func
(
req
*
cmds
.
Request
,
res
cmds
.
ResponseEmitter
,
env
cmds
.
Environment
)
error
{
api
,
err
:=
cmdenv
.
GetApi
(
env
,
req
)
...
...
@@ -209,7 +213,7 @@ to a file containing 'bar', and returns the hash of the new object.
return
err
}
create
,
_
:=
req
.
Options
[
"
create
"
]
.
(
bool
)
create
,
_
:=
req
.
Options
[
create
OptionName
]
.
(
bool
)
if
err
!=
nil
{
return
err
}
...
...
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