Commit 54587897 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

cmd/ipfs: Default to plaintext encoding if avilable, otherwise JSON

parent edb632a6
......@@ -87,6 +87,14 @@ func main() {
ctx.ConfigRoot = configPath
ctx.Config = conf
if _, found := options.Option("encoding"); !found {
if req.Command().Format != nil {
req.SetOption("encoding", cmds.Text)
} else {
req.SetOption("encoding", cmds.JSON)
}
}
var res cmds.Response
if root == Root {
res = root.Call(req)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment