object patch rm-link: change arg from 'link' to 'name'
This improves the semantics of rm-link to be consistent with add-link, clarifying that you should specify the link name as the thing to remove. License: MIT Signed-off-by: Ryan Carver <ryan@ryancarver.com>
Ryan Carver committed
Oct 24, 2018 at 10:05 UTC
6aa8525f6e1d255c9fcaaf9eb20083155d77ead8
1 file changed
+5
-5
core/commands/object/patch.go
+5
-5
@@ -145,14 +145,14 @@ Example:
145
146
var patchRmLinkCmd = &oldcmds.Command{
147
Helptext: cmdkit.HelpText{
148
- Tagline: "Remove a link from an object.",
148
+ Tagline: "Remove a link from a given object.",
149
ShortDescription: `
150
-Removes a link by the given name from root.
150
+Remove a Merkle-link from the given object and return the hash of the result.
151
`,
152
},
153
Arguments: []cmdkit.Argument{
154
cmdkit.StringArg("root", true, false, "The hash of the node to modify."),
155
- cmdkit.StringArg("link", true, false, "Name of the link to remove."),
155
+ cmdkit.StringArg("name", true, false, "Name of the link to remove."),
156
},
157
Run: func(req oldcmds.Request, res oldcmds.Response) {
158
api, err := req.InvocContext().GetApi()
@@ -167,8 +167,8 @@ Removes a link by the given name from root.
167
return
168
}
169
170
- link := req.Arguments()[1]
171
- p, err := api.Object().RmLink(req.Context(), root, link)
170
+ name := req.Arguments()[1]
171
+ p, err := api.Object().RmLink(req.Context(), root, name)
172
if err != nil {
173
res.SetError(err, cmdkit.ErrNormal)
174
return