mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
Tidy up object put cmd defaults
License: MIT Signed-off-by: slothbag <slothbag@gmail.com>
This commit is contained in:
@ -344,7 +344,7 @@ And then run:
|
|||||||
},
|
},
|
||||||
Options: []cmds.Option{
|
Options: []cmds.Option{
|
||||||
cmds.StringOption("inputenc", "Encoding type of input data, either \"protobuf\" or \"json\"."),
|
cmds.StringOption("inputenc", "Encoding type of input data, either \"protobuf\" or \"json\"."),
|
||||||
cmds.StringOption("datafieldenc", "Encoding type of the data field, either \"text\" or \"base64\"."),
|
cmds.StringOption("datafieldenc", "Encoding type of the data field, either \"text\" or \"base64\".").Default("text"),
|
||||||
},
|
},
|
||||||
Run: func(req cmds.Request, res cmds.Response) {
|
Run: func(req cmds.Request, res cmds.Response) {
|
||||||
n, err := req.InvocContext().GetNode()
|
n, err := req.InvocContext().GetNode()
|
||||||
@ -373,10 +373,7 @@ And then run:
|
|||||||
res.SetError(err, cmds.ErrNormal)
|
res.SetError(err, cmds.ErrNormal)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !found {
|
|
||||||
datafieldenc = "text"
|
|
||||||
}
|
|
||||||
|
|
||||||
output, err := objectPut(n, input, inputenc, datafieldenc)
|
output, err := objectPut(n, input, inputenc, datafieldenc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errType := cmds.ErrNormal
|
errType := cmds.ErrNormal
|
||||||
|
Reference in New Issue
Block a user