提交 54587897 作者: Matt Bell 提交者: Juan Batiz-Benet

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

上级 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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论