Tidy up object put cmd defaults
License: MIT Signed-off-by: slothbag <slothbag@gmail.com>
slothbag committed
Apr 4, 2016 at 13:08 UTC
edf0bb0544e2b2e901cbf01f6122c3b6874e003c
1 file changed
+2
-5
core/commands/object/object.go
+2
-5
@@ -344,7 +344,7 @@ And then run:
344
},
345
Options: []cmds.Option{
346
cmds.StringOption("inputenc", "Encoding type of input data, either \"protobuf\" or \"json\"."),
347
- cmds.StringOption("datafieldenc", "Encoding type of the data field, either \"text\" or \"base64\"."),
347
+ cmds.StringOption("datafieldenc", "Encoding type of the data field, either \"text\" or \"base64\".").Default("text"),
348
},
349
Run: func(req cmds.Request, res cmds.Response) {
350
n, err := req.InvocContext().GetNode()
@@ -373,10 +373,7 @@ And then run:
373
res.SetError(err, cmds.ErrNormal)
374
return
375
}
376
- if !found {
377
- datafieldenc = "text"
378
- }
379
-
376
+
377
output, err := objectPut(n, input, inputenc, datafieldenc)
378
if err != nil {
379
errType := cmds.ErrNormal